Merge branch '3699-arv-copy'
[arvados.git] / apps / workbench / test / unit / pipeline_instance_test.rb
1 require 'test_helper'
2
3 class PipelineInstanceTest < ActiveSupport::TestCase
4   test "admin can edit name" do
5     use_token :admin
6     assert(find_fixture(PipelineInstance, "new_pipeline_in_subproject")
7              .attribute_editable?("name"),
8            "admin not allowed to edit pipeline instance name")
9   end
10
11   test "project owner can edit name" do
12     use_token :active
13     assert(find_fixture(PipelineInstance, "new_pipeline_in_subproject")
14              .attribute_editable?("name"),
15            "project owner not allowed to edit pipeline instance name")
16   end
17
18   test "project admin can edit name" do
19     use_token :subproject_admin
20     assert(find_fixture(PipelineInstance, "new_pipeline_in_subproject")
21              .attribute_editable?("name"),
22            "project admin not allowed to edit pipeline instance name")
23   end
24
25   test "project viewer cannot edit name" do
26     use_token :project_viewer
27     refute(find_fixture(PipelineInstance, "new_pipeline_in_subproject")
28              .attribute_editable?("name"),
29            "project viewer allowed to edit pipeline instance name")
30   end
31 end