Merge branch 'master' into 3504-clients-compatible-with-3036
[arvados.git] / apps / workbench / test / integration / collections_test.rb
index 8ac8fe4fb360c1a95683de09bbe8f621879fd301..19720cb752cfc83823e77337956d08c29b4227b6 100644 (file)
@@ -13,19 +13,17 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     page.assert_no_selector "div[data-persistent-state='#{oldstate}']"
   end
 
-  ['/collections', '/users/welcome'].each do |path|
-    test "Flip persistent switch at #{path}" do
-      Capybara.current_driver = Capybara.javascript_driver
-      uuid = api_fixture('collections')['foo_file']['uuid']
-      visit page_with_token('active', path)
-      within "tr[data-object-uuid='#{uuid}']" do
-        change_persist 'cache', 'persistent'
-      end
-      # Refresh page and make sure the change was committed.
-      visit current_path
-      within "tr[data-object-uuid='#{uuid}']" do
-        change_persist 'persistent', 'cache'
-      end
+  test "Flip persistent switch at /collections" do
+    Capybara.current_driver = Capybara.javascript_driver
+    uuid = api_fixture('collections')['foo_file']['uuid']
+    visit page_with_token('active', '/collections')
+    within "tr[data-object-uuid='#{uuid}']" do
+      change_persist 'cache', 'persistent'
+    end
+    # Refresh page and make sure the change was committed.
+    visit current_path
+    within "tr[data-object-uuid='#{uuid}']" do
+      change_persist 'persistent', 'cache'
     end
   end
 
@@ -74,4 +72,10 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert_equal(['foo'], hrefs.compact.sort,
                  "download page did provide strictly file links")
   end
+
+  test "can view empty collection" do
+    uuid = 'd41d8cd98f00b204e9800998ecf8427e+0'
+    visit page_with_token('active', "/collections/#{uuid}")
+    assert page.has_text?('This collection is empty')
+  end
 end