4523: Merge branch '4523-search-index' of git.curoverse.com:arvados into 4523-search...
[arvados.git] / apps / workbench / test / unit / job_test.rb
1 require 'test_helper'
2
3 class JobTest < ActiveSupport::TestCase
4   test "admin can edit description" do
5     use_token :admin
6     assert(find_fixture(Job, "job_in_subproject")
7              .attribute_editable?("description"),
8            "admin not allowed to edit job description")
9   end
10
11   test "project owner can edit description" do
12     use_token :active
13     assert(find_fixture(Job, "job_in_subproject")
14              .attribute_editable?("description"),
15            "project owner not allowed to edit job description")
16   end
17
18   test "project admin can edit description" do
19     use_token :subproject_admin
20     assert(find_fixture(Job, "job_in_subproject")
21              .attribute_editable?("description"),
22            "project admin not allowed to edit job description")
23   end
24
25   test "project viewer cannot edit description" do
26     use_token :project_viewer
27     refute(find_fixture(Job, "job_in_subproject")
28              .attribute_editable?("description"),
29            "project viewer allowed to edit job description")
30   end
31 end