Merge branch 'master' into 6465-optimize-workbench-integration-tests
[arvados.git] / apps / workbench / test / integration / anonymous_access_test.rb
index 18c5b7dfcb9c36eda3f31cf4dd095e6f46484eb6..7d3dfabd6448ee56ce7d688c7a1f3dc9b7cacabd 100644 (file)
@@ -18,13 +18,17 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
       if user['is_active']
         assert_text 'Unrestricted public data'
         assert_selector 'a', text: 'Projects'
+        page.find("#projects-menu").click
+        assert_selector 'a', text: 'Add a new project'
+        assert_selector 'a', text: 'Browse public projects'
+        assert page.has_text?('Projects shared with me'), 'Not found text - Project shared with me'
       else
         assert_text 'indicate that you have read and accepted the user agreement'
       end
       within('.navbar-fixed-top') do
         assert_selector 'a', text: Rails.configuration.site_name.downcase
-        assert_selector 'a', text: "#{user['email']}"
-        find('a', text: "#{user['email']}").click
+        assert(page.has_link?("notifications-menu"), 'no user menu')
+        page.find("#notifications-menu").click
         within('.dropdown-menu') do
           assert_selector 'a', text: 'Log out'
         end
@@ -35,6 +39,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
         assert_text Rails.configuration.site_name.downcase
         assert_no_selector 'a', text: Rails.configuration.site_name.downcase
         assert_selector 'a', text: 'Log in'
+        assert_selector 'a', text: 'Browse public projects'
       end
     end
   end
@@ -305,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