end
def test_linkify
- %w(http://example.com/test ftp://example.com/test https://example.com/test).each do |link|
+ %w[http://example.com/test ftp://example.com/test https://example.com/test].each do |link|
text = "Test #{link} is made into a link"
html = linkify(text)
assert_dom_equal "Test <a href=\"#{link}\" rel=\"nofollow\">#{link}</a> is made into a link", html
end
- %w(test@example.com mailto:test@example.com).each do |link|
+ %w[test@example.com mailto:test@example.com].each do |link|
text = "Test #{link} is not made into a link"
html = linkify(text)
def test_if_user
user = create(:user)
+
html = if_user(user) { "Test 1" }
assert_dom_equal "<div class=\"hidden show_if_user_#{user.id}\">Test 1</div>", html
def test_unless_user
user = create(:user)
+
html = unless_user(user) { "Test 1" }
assert_dom_equal "<div class=\"hide_if_user_#{user.id}\">Test 1</div>", html