preferences_permission_check_test.rb 1.4 KB

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