X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3d3f25043f3f270a675391237a2a2a73495e1e37..f42c7e3d3344104206ca0b8669e2b07a6b30388e:/apps/workbench/test/controllers/projects_controller_test.rb diff --git a/apps/workbench/test/controllers/projects_controller_test.rb b/apps/workbench/test/controllers/projects_controller_test.rb index 62a93a1308..ba4188e4c5 100644 --- a/apps/workbench/test/controllers/projects_controller_test.rb +++ b/apps/workbench/test/controllers/projects_controller_test.rb @@ -306,4 +306,55 @@ class ProjectsControllerTest < ActionController::TestCase assert_match /\/users\/welcome/, @response.redirect_url assert_empty css_select('[href="/projects/public"]') end + + test "find a project and edit its description" do + project = api_fixture('groups')['aproject'] + use_token :active + found = Group.find(project['uuid']) + found.description = 'test description update' + found.save! + get(:show, {id: project['uuid']}, session_for(:active)) + assert_includes @response.body, 'test description update' + end + + test "find a project and edit description to textile description" do + project = api_fixture('groups')['aproject'] + use_token :active + found = Group.find(project['uuid']) + found.description = '*test bold description for textile formatting*' + found.save! + get(:show, {id: project['uuid']}, session_for(:active)) + assert_includes @response.body, 'test bold description for textile formatting' + end + + test "find a project and edit description to html description" do + project = api_fixture('groups')['aproject'] + use_token :active + found = Group.find(project['uuid']) + found.description = 'Textile description with link to home page take me home.' + found.save! + get(:show, {id: project['uuid']}, session_for(:active)) + assert_not_includes 'Textile description with link to home page take me home.', @response.body + assert_match /Textile description with link to home page .*a href=.*take me home.*\/a.*./, @response.body + end + + test "find a project and edit description to textile description with link to object" do + project = api_fixture('groups')['aproject'] + use_token :active + found = Group.find(project['uuid']) + found.description = '"Link to object":' + api_fixture('groups')['asubproject']['uuid'] + found.save! + get(:show, {id: project['uuid']}, session_for(:active)) + assert_not_includes '"Link to object"', @response.body + assert_match /href=.*Link to object.*\/a./, @response.body + refute_empty css_select('[href="/groups/zzzzz-j7d0g-axqo7eu9pwvna1x"]') + end + + test "project viewer can't see project sharing tab" do + project = api_fixture('groups')['aproject'] + get(:show, {id: project['uuid']}, session_for(:project_viewer)) + refute_includes @response.body, '