6465-Made changes that were recommended.
authorManoj <jonam33@gmail.com>
Mon, 20 Jul 2015 15:35:55 +0000 (11:35 -0400)
committerManoj <jonam33@gmail.com>
Mon, 20 Jul 2015 15:35:55 +0000 (11:35 -0400)
apps/workbench/test/controllers/collections_controller_test.rb
apps/workbench/test/controllers/projects_controller_test.rb
apps/workbench/test/controllers/users_controller_test.rb

index 7d643849e2f976bcdf735b52c8e7eb9053bc9308..13644e00bdce28db3460aa2f722f679deb107c7e 100644 (file)
@@ -494,7 +494,7 @@ class CollectionsControllerTest < ActionController::TestCase
     assert matches.size > 1
 
     matches.each do |k,v|
-      assert_match /href="\/collections\/#{v['uuid']}".*#{v['name']}<\/a>/, @response.body
+      assert_match /href="\/collections\/#{v['uuid']}">.*#{v['name']}<\/a>/, @response.body
     end
 
     assert_includes @response.body, 'The following collections have this content:'
@@ -507,7 +507,7 @@ class CollectionsControllerTest < ActionController::TestCase
     collection = api_fixture('collections')['foo_file']
     get :show, {id: collection['uuid']}, session_for(:active)
     assert_includes @response.body, collection['name']
-    assert_match /href="#{collection['uuid']}.*foo.*/, @response.body
+    assert_match /href="#{collection['uuid']}\/foo" ><\/i> foo</, @response.body
   end
 
   test "No Upload tab on non-writable collection" do
index a036a8f4f6bdb04603ded2e826492a4ffd9f4b89..7f2b2cd3f2818483920e9284bd95133a8a29fd21 100644 (file)
@@ -334,8 +334,7 @@ class ProjectsControllerTest < ActionController::TestCase
     found.description = 'Textile description with link to home page <a href="/">take me home</a>.'
     found.save!
     get(:show, {id: project['uuid']}, session_for(:active))
-    assert_not_includes 'Textile description with link to home page <a href="/">take me home</a>.', @response.body
-    assert_match /Textile description with link to home page .*a href=.*take me home.*\/a.*./, @response.body
+    assert_includes @response.body, 'Textile description with link to home page <a href="/">take me home</a>.'
   end
 
   test "find a project and edit description to textile description with link to object" do
@@ -345,8 +344,7 @@ class ProjectsControllerTest < ActionController::TestCase
     found.description = '"Link to object":' + api_fixture('groups')['asubproject']['uuid']
     found.save!
     get(:show, {id: project['uuid']}, session_for(:active))
-    assert_not_includes '"Link to object"', @response.body
-    assert_match /href=.*Link to object.*\/a./, @response.body
+    refute_includes  @response.body,'"Link to object"'
     refute_empty css_select('[href="/groups/zzzzz-j7d0g-axqo7eu9pwvna1x"]')
   end
 
index f439d6eab28a2c9b368778cdfed11e382cf8bbc1..6b9cd6efa647edd391d78ff79a6e8bbd429348c9 100644 (file)
@@ -85,16 +85,16 @@ class UsersControllerTest < ActionController::TestCase
       active_user = api_fixture('users','active')
       get :index, {}, session_for(username)
       if username == 'admin'
-        assert_match /<a href="\/projects\/#{admin_user['uuid']}">Home<\/a.*./, @response.body
-        assert_match /<a href="\/projects\/#{active_user['uuid']}">Home<\/a.*./, @response.body
-        assert_match /<a.*href="\/users\/#{admin_user['uuid']}".*Show<\/a.*./, @response.body
-        assert_match /<a.*href="\/users\/#{active_user['uuid']}".*Show<\/a.*./, @response.body
+        assert_match /<a href="\/projects\/#{admin_user['uuid']}">Home<\/a>/, @response.body
+        assert_match /<a href="\/projects\/#{active_user['uuid']}">Home<\/a>/, @response.body
+        assert_match /href="\/users\/#{admin_user['uuid']}" title="show user"><i class="fa fa-fw fa-user"><\/i> Show<\/a/, @response.body
+        assert_match /href="\/users\/#{active_user['uuid']}" title="show user"><i class="fa fa-fw fa-user"><\/i> Show<\/a/, @response.body
         assert_includes @response.body, admin_user['email']
         assert_includes @response.body, active_user['email']
       else
-        refute_match  /a href=.*Home<.*\/a.*./, @response.body
-        refute_match /<a.*href="\/users\/#{admin_user['uuid']}".*Show<\/a.*./, @response.body
-        assert_match /<a.*href="\/users\/#{active_user['uuid']}".*Show<\/a.*./, @response.body
+        refute_match  /Home<\/a>/, @response.body
+        refute_match /href="\/users\/#{admin_user['uuid']}" title="show user"><i class="fa fa-fw fa-user"><\/i> Show<\/a/, @response.body
+        assert_match /href="\/users\/#{active_user['uuid']}" title="show user"><i class="fa fa-fw fa-user"><\/i> Show<\/a/, @response.body
         assert_includes @response.body, active_user['email']
       end
     end