X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a59152e34814f453a7380e68a55534e2f8922d57..b7ec383316ca68220f9f54fe1602766284854173:/apps/workbench/test/unit/job_test.rb diff --git a/apps/workbench/test/unit/job_test.rb b/apps/workbench/test/unit/job_test.rb index 5079316934..add4c0fd55 100644 --- a/apps/workbench/test/unit/job_test.rb +++ b/apps/workbench/test/unit/job_test.rb @@ -1,7 +1,31 @@ require 'test_helper' class JobTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "admin can edit description" do + use_token :admin + assert(find_fixture(Job, "job_in_subproject") + .attribute_editable?("description"), + "admin not allowed to edit job description") + end + + test "project owner can edit description" do + use_token :active + assert(find_fixture(Job, "job_in_subproject") + .attribute_editable?("description"), + "project owner not allowed to edit job description") + end + + test "project admin can edit description" do + use_token :subproject_admin + assert(find_fixture(Job, "job_in_subproject") + .attribute_editable?("description"), + "project admin not allowed to edit job description") + end + + test "project viewer cannot edit description" do + use_token :project_viewer + refute(find_fixture(Job, "job_in_subproject") + .attribute_editable?("description"), + "project viewer allowed to edit job description") + end end