6465: Removed two tests from projects test and added two to projects
authorManoj <jonam33@gmail.com>
Tue, 21 Jul 2015 15:21:54 +0000 (11:21 -0400)
committerManoj <jonam33@gmail.com>
Tue, 21 Jul 2015 15:21:54 +0000 (11:21 -0400)
controller test.

apps/workbench/test/controllers/projects_controller_test.rb
apps/workbench/test/integration/projects_test.rb

index 4be4c089a2864f85b61bff83064a54d1a366e8cd..cb4ef9913b0cb0fa9c272db6d4c28724b30aa53e 100644 (file)
@@ -370,4 +370,31 @@ class ProjectsControllerTest < ActionController::TestCase
      assert_includes @response.body, '<div id="Data_collections"'
     end
   end
+
+  [
+    ['admin',true],
+    ['active',true],
+    ['project_viewer',false],
+  ].each do |user, can_move|
+    test "#{user} can move subproject from project #{can_move}" do
+      get(:show, {id: api_fixture('groups')['aproject']['uuid']}, session_for(user))
+      if can_move
+        assert_includes @response.body, 'Move project...'
+      else
+        refute_includes @response.body, 'Move project...'
+      end
+    end
+  end
+
+  [
+    ["jobs", "/jobs"],
+    ["pipelines", "/pipeline_instances"],
+    ["collections", "/collections"],
+  ].each do |target,path|
+    test "test dashboard button all #{target}" do
+      get :index, {}, session_for(:active)
+      refute_empty css_select("[href=\"#{path}\"]")
+      assert_includes @response.body, "All #{target}"
+    end
+  end
 end
index e6eaa7f67f4484cc855a45677721a44fd78bfeef..dc54b8d1c14e892e9640120999340279c8cf4e9c 100644 (file)
@@ -408,18 +408,6 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     end
   end
 
-  [
-    ["jobs", "/jobs"],
-    ["pipelines", "/pipeline_instances"],
-    ["collections", "/collections"]
-  ].each do |target,path|
-    test "Test dashboard button all #{target}" do
-      visit page_with_token 'active', '/'
-      click_link "All #{target}"
-      assert_equal path, current_path
-    end
-  end
-
   def scroll_setup(project_name,
                    total_nbr_items,
                    item_list_parameter,
@@ -542,26 +530,6 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     end
   end
 
-  # Move button accessibility
-  [
-    ['admin', true],
-    ['active', true],  # project owner
-    ['project_viewer', false],
-    ].each do |user, can_move|
-    test "#{user} can move subproject under another user's Home #{can_move}" do
-      project = api_fixture('groups')['aproject']
-      collection = api_fixture('collections')['collection_to_move_around_in_aproject']
-
-      # verify the project move button
-      visit page_with_token user, "/projects/#{project['uuid']}"
-      if can_move
-        assert page.has_link? 'Move project...'
-      else
-        assert page.has_no_link? 'Move project...'
-      end
-    end
-  end
-
   test "error while loading tab" do
     original_arvados_v1_base = Rails.configuration.arvados_v1_base