diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-21 17:50:06 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-21 17:50:06 -0700 |
commit | aab2f0b353d4d8d80605dda328ca3c28f680e2b1 (patch) | |
tree | 100a3192923dea387b59ef1b9364d3d940753b33 /actionpack/test/controller | |
parent | 09343166ac213e5fcbd3eb5b21d44606b56afa62 (diff) | |
parent | 98fb161dbb13feb18165468aedf1581d5c2305f4 (diff) | |
download | rails-aab2f0b353d4d8d80605dda328ca3c28f680e2b1.tar.gz rails-aab2f0b353d4d8d80605dda328ca3c28f680e2b1.tar.bz2 rails-aab2f0b353d4d8d80605dda328ca3c28f680e2b1.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 7 | ||||
-rw-r--r-- | actionpack/test/controller/polymorphic_routes_test.rb | 22 |
2 files changed, 25 insertions, 4 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index a5373912f5..c986941140 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -327,9 +327,12 @@ class IntegrationProcessTest < ActionController::IntegrationTest assert_equal ["410 Gone"], headers["status"] assert_response 410 assert_response :gone - assert_equal nil, response.headers["Set-Cookie"] + assert_equal ["cookie_1=; path=/", "cookie_3=chocolate; path=/"], response.headers["Set-Cookie"] assert_equal ["cookie_1=; path=/", "cookie_3=chocolate; path=/"], headers['set-cookie'] - assert_equal [[], ["chocolate"]], response.headers["cookie"] + assert_equal [ + CGI::Cookie::new("name" => "cookie_1", "value" => ""), + CGI::Cookie::new("name" => "cookie_3", "value" => "chocolate") + ], response.headers["cookie"] assert_equal [], headers["cookie"] assert_equal({"cookie_1"=>"", "cookie_2"=>"oatmeal", "cookie_3"=>"chocolate"}, cookies) assert_equal "Gone", response.body diff --git a/actionpack/test/controller/polymorphic_routes_test.rb b/actionpack/test/controller/polymorphic_routes_test.rb index 3f52526f08..6ddf2826cd 100644 --- a/actionpack/test/controller/polymorphic_routes_test.rb +++ b/actionpack/test/controller/polymorphic_routes_test.rb @@ -60,6 +60,18 @@ uses_mocha 'polymorphic URL helpers' do edit_polymorphic_url(@article) end + def test_url_helper_prefixed_with_edit_with_url_options + @article.save + expects(:edit_article_url).with(@article, :param1 => '10') + edit_polymorphic_url(@article, :param1 => '10') + end + + def test_url_helper_with_url_options + @article.save + expects(:article_url).with(@article, :param1 => '10') + polymorphic_url(@article, :param1 => '10') + end + def test_formatted_url_helper expects(:formatted_article_url).with(@article, :pdf) formatted_polymorphic_url([@article, :pdf]) @@ -67,10 +79,16 @@ uses_mocha 'polymorphic URL helpers' do def test_format_option @article.save - expects(:article_url).with(@article, :pdf) + expects(:formatted_article_url).with(@article, :pdf) polymorphic_url(@article, :format => :pdf) end + def test_format_option_with_url_options + @article.save + expects(:formatted_article_url).with(@article, :pdf, :param1 => '10') + polymorphic_url(@article, :format => :pdf, :param1 => '10') + end + def test_id_and_format_option @article.save expects(:article_url).with(:id => @article, :format => :pdf) @@ -147,7 +165,7 @@ uses_mocha 'polymorphic URL helpers' do def test_nesting_with_array_containing_singleton_resource_and_format_option @tag = Tag.new @tag.save - expects(:article_response_tag_url).with(@article, @tag, :pdf) + expects(:formatted_article_response_tag_url).with(@article, @tag, :pdf) polymorphic_url([@article, :response, @tag], :format => :pdf) end |