Skip to content
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.

Commit

Permalink
Merge f0f9142 into d4a193e
Browse files Browse the repository at this point in the history
  • Loading branch information
sanemat committed Apr 9, 2014
2 parents d4a193e + f0f9142 commit 41b6fd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ gemfile:
- gemfiles/rails_3_2_stable.gemfile
- gemfiles/rails_4_0.gemfile
- gemfiles/rails_4_0_stable.gemfile
- gemfiles/rails_4_1.gemfile
- gemfiles/rails_4_1_stable.gemfile
- gemfiles/rails_master.gemfile
branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion lib/action_view/link_to_blank/link_to_blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def link_to_blank_unless(condition, name, options = {}, html_options = {}, &bloc
if block_given?
block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
else
name
ERB::Util.html_escape(name)
end
else
link_to_blank(name, options, html_options)
Expand Down
11 changes: 7 additions & 4 deletions test/test_actionview-link_to_blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class TestActionViewLinkToBlank < MiniTest::Test
# In those cases, we'll set up a simple mock
attr_accessor :controller, :request

cattr_accessor :request_forgery
self.request_forgery = false

routes = ActionDispatch::Routing::RouteSet.new
routes.draw do
get "/" => "foo#bar"
Expand Down Expand Up @@ -315,10 +318,10 @@ def test_link_to_unless
}

# FIXME
# assert_equal %{&lt;b&gt;Showing&lt;/b&gt;}, link_to_unless(true, "<b>Showing</b>", url_hash)
# assert_equal %{<a href="/">&lt;b&gt;Showing&lt;/b&gt;</a>}, link_to_unless(false, "<b>Showing</b>", url_hash)
# assert_equal %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>".html_safe, url_hash)
# assert_equal %{<a href="/"><b>Showing</b></a>}, link_to_unless(false, "<b>Showing</b>".html_safe, url_hash)
assert_equal %{&lt;b&gt;Showing&lt;/b&gt;}, link_to_blank_unless(true, "<b>Showing</b>", url_hash)
assert_equal %{<a href="/">&lt;b&gt;Showing&lt;/b&gt;</a>}, link_to_unless(false, "<b>Showing</b>", url_hash)
assert_equal %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>".html_safe, url_hash)
assert_equal %{<a href="/"><b>Showing</b></a>}, link_to_unless(false, "<b>Showing</b>".html_safe, url_hash)
end

def test_link_to_if
Expand Down

0 comments on commit 41b6fd5

Please sign in to comment.