From: Manoj Date: Thu, 2 Jul 2015 17:55:45 +0000 (-0400) Subject: 6465: Moved the test "anonymous user accesses collection in shared project" from... X-Git-Tag: 1.1.0~1482^2~17 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/6e7c96b2bdf0498028bf6ee3902289e81ec1f2d7?ds=sidebyside 6465: Moved the test "anonymous user accesses collection in shared project" from integration into controller tests. --- diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb index b99ab95500..dd9aefc5b2 100644 --- a/apps/workbench/test/controllers/collections_controller_test.rb +++ b/apps/workbench/test/controllers/collections_controller_test.rb @@ -461,4 +461,15 @@ class CollectionsControllerTest < ActionController::TestCase assert_equal files.sort, disabled.sort, "Expected to see all collection files in disabled list of files" end + + test "anonymous user accesses collection in shared project" do + Rails.configuration.anonymous_user_token = + api_fixture('api_client_authorizations')['anonymous']['api_token'] + collection = api_fixture('collections')['public_text_file'] + get(:show, {id: collection['uuid']}) + + response_object = assigns(:object) + assert_equal collection['name'], response_object['name'] + assert_equal collection['uuid'], response_object['uuid'] + end end diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb index 8ac3a56cb4..7d3dfabd64 100644 --- a/apps/workbench/test/integration/anonymous_access_test.rb +++ b/apps/workbench/test/integration/anonymous_access_test.rb @@ -310,14 +310,4 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest end end end - - test "anonymous user accesses collection in shared project" do - visit "/collections/#{api_fixture('collections')['public_text_file']['uuid']}" - - # in collection page - assert_text 'Public Projects Unrestricted public data' - assert_text 'Hello world' - assert_text 'Content address' - assert_selector 'a', text: 'Provenance graph' - end end