Also convert some of the simple integration tests into controller tests.
- Software developer
- IT
- Other
- anonymous_user_token: 4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi
common:
assets.js_compressor: false
}]
get :show, encoded_params, session_for(:active)
end
+
+ test "visit non-public project as anonymous when anonymous browsing is enabled and expect page not found" do
+ Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+ get(:show, {id: api_fixture('groups')['aproject']['uuid']})
+ assert_response 404
+ assert_includes @response.inspect, 'you are not logged in'
+ end
+
+ test "visit home page as anonymous when anonymous browsing is enabled and expect login" do
+ Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+ get(:index)
+ assert_response :redirect
+ assert_match /\/users\/welcome/, @response.redirect_url
+ end
end
end
end
- test "visit non-public project as anonymous when anonymous browsing is enabled and expect page not found" do
- visit "/projects/#{api_fixture('groups')['aproject']['uuid']}"
- assert_text 'Not Found'
- end
-
- test "anonymous user clicking on topnav sees login page" do
- visit PUBLIC_PROJECT
-
- # click on topnav
- click_link 'workbench:test'
- assert_text 'Please log in'
- end
-
test "selection actions when anonymous user accesses shared project" do
visit PUBLIC_PROJECT
assert_text 'script version'
assert_no_selector 'a', text: 'Run this pipeline'
end
-
- test "visit public project as anonymous when anonymous browsing is not enabled and expect login page" do
- Rails.configuration.anonymous_user_token = false
- visit "/projects/#{api_fixture('groups')['aproject']['uuid']}"
- assert_text 'Please log in'
- end
end
Rails.configuration.arvados_v1_base = original_arvados_v1_base
end
end
-
- test "404 page checks if user not logged in and makes suggestion" do
- visit "/collections/#{BAD_UUID}"
- assert_text 'you are not logged in'
- end
-
end