preferences_permission_check_test.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. require 'browser_test_helper'
  2. class PreferencesPermissionCheckTest < TestCase
  3. def test_permission_agent
  4. @browser = browser_instance
  5. login(
  6. username: 'master@example.com',
  7. password: 'test',
  8. url: browser_url,
  9. )
  10. click(css: 'a[href="#current_user"]')
  11. click(css: 'a[href="#profile"]')
  12. match(
  13. css: '.content .NavBarProfile',
  14. value: 'Password',
  15. )
  16. match(
  17. css: '.content .NavBarProfile',
  18. value: 'Language',
  19. )
  20. match(
  21. css: '.content .NavBarProfile',
  22. value: 'Notifications',
  23. )
  24. match(
  25. css: '.content .NavBarProfile',
  26. value: 'Calendar',
  27. )
  28. match(
  29. css: '.content .NavBarProfile',
  30. value: 'Token Access',
  31. )
  32. end
  33. def test_permission_customer
  34. @browser = browser_instance
  35. login(
  36. username: 'nicole.braun@zammad.org',
  37. password: 'test',
  38. url: browser_url,
  39. )
  40. click(css: 'a[href="#current_user"]')
  41. click(css: 'a[href="#profile"]')
  42. match(
  43. css: '.content .NavBarProfile',
  44. value: 'Password',
  45. )
  46. match(
  47. css: '.content .NavBarProfile',
  48. value: 'Language',
  49. )
  50. match_not(
  51. css: '.content .NavBarProfile',
  52. value: 'Notifications',
  53. )
  54. match_not(
  55. css: '.content .NavBarProfile',
  56. value: 'Calendar',
  57. )
  58. match_not(
  59. css: '.content .NavBarProfile',
  60. value: 'Token Access',
  61. )
  62. end
  63. end