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:'
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
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
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
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