diff options
| author | Manuel Menezes de Sequeira <MMSequeira@gmail.com> | 2011-10-05 22:14:49 +0100 |
|---|---|---|
| committer | Manuel Menezes de Sequeira <MMSequeira@gmail.com> | 2011-10-05 22:14:49 +0100 |
| commit | 07343d2974ab77bfd21c0f35930cd394ba5b164e (patch) | |
| tree | c64f8b54507d41ccb2c59cb096ee8b1f2a31e2df /actionpack/test/controller | |
| parent | 8d775d5f1d58e5c0d881383e8c6e869d1d360c8c (diff) | |
| parent | d6c7185d77158caee933e84b247e37bb6a67bf58 (diff) | |
| download | rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.gz rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.bz2 rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.zip | |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/test/controller')
| -rw-r--r-- | actionpack/test/controller/test_test.rb | 36 | ||||
| -rw-r--r-- | actionpack/test/controller/url_for_test.rb | 14 |
2 files changed, 50 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index cba3aded2f..b64e275363 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -146,6 +146,17 @@ XML end end + class ViewAssignsController < ActionController::Base + def test_assigns + @foo = "foo" + render :nothing => true + end + + def view_assigns + { "bar" => "bar" } + end + end + def test_raw_post_handling params = ActiveSupport::OrderedHash[:page, {:name => 'page name'}, 'some key', 123] post :render_raw_post, params.dup @@ -256,6 +267,15 @@ XML assert_equal "foo", assigns["foo"] end + def test_view_assigns + @controller = ViewAssignsController.new + process :test_assigns + assert_equal nil, assigns(:foo) + assert_equal nil, assigns[:foo] + assert_equal "bar", assigns(:bar) + assert_equal "bar", assigns[:bar] + end + def test_assert_tag_tag process :test_html_output @@ -754,6 +774,22 @@ class CrazyNameTest < ActionController::TestCase end end +class CrazySymbolNameTest < ActionController::TestCase + tests :content + + def test_set_controller_class_using_symbol + assert_equal ContentController, self.class.controller_class + end +end + +class CrazyStringNameTest < ActionController::TestCase + tests 'content' + + def test_set_controller_class_using_string + assert_equal ContentController, self.class.controller_class + end +end + class NamedRoutesControllerTest < ActionController::TestCase tests ContentController diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index 484e996f31..11ced2df2a 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -67,6 +67,20 @@ module AbstractController ) end + def test_subdomain_may_be_removed + add_host! + assert_equal('http://basecamphq.com/c/a/i', + W.new.url_for(:subdomain => false, :controller => 'c', :action => 'a', :id => 'i') + ) + end + + def test_multiple_subdomains_may_be_removed + W.default_url_options[:host] = 'mobile.www.api.basecamphq.com' + assert_equal('http://basecamphq.com/c/a/i', + W.new.url_for(:subdomain => false, :controller => 'c', :action => 'a', :id => 'i') + ) + end + def test_domain_may_be_changed add_host! assert_equal('http://www.37signals.com/c/a/i', |
