From 258bacbf8221dc20a83cfaa03decfb522bda3ffb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 4 Sep 2005 00:33:45 +0000 Subject: Added :popup option to UrlHelper#link_to #1996 [gabriel.gironda@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/url_helper_test.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'actionpack/test/template/url_helper_test.rb') diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 8367108fab..73d87f6956 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -62,6 +62,32 @@ class UrlHelperTest < Test::Unit::TestCase ) end + def test_link_tag_with_popup + assert_equal( + "Hello", + link_to("Hello", "http://www.example.com", :popup => true) + ) + assert_equal( + "Hello", + link_to("Hello", "http://www.example.com", :popup => 'true') + ) + assert_equal( + "Hello", + link_to("Hello", "http://www.example.com", :popup => ['window_name', 'width=300,height=300']) + ) + end + + def test_link_tag_with_popup_and_javascript_confirm + assert_equal( + "Hello", + link_to("Hello", "http://www.example.com", { :popup => true, :confirm => "Fo' sho'?" }) + ) + assert_equal( + "Hello", + link_to("Hello", "http://www.example.com", { :popup => ['window_name', 'width=300,height=300'], :confirm => "Are you serious?" }) + ) + end + def test_link_to_unless assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog") assert "Listing", link_to_unless(false, "Listing", :action => "list", :controller => "weblog") -- cgit v1.2.3