aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-05-06 20:53:56 +1200
committerMichael Koziarski <michael@koziarski.com>2008-05-06 20:53:56 +1200
commita08004a9a7d4c93c39f9693f6406ecb70d6a38c0 (patch)
tree531584bf588a3b288ab14a8e16540ab947a0ec45 /actionpack/test
parentc26d10563eaa29961ae895a9fbe3afae7d24a9b1 (diff)
parent04f52219f11944e50555dc59917c73c99581dac0 (diff)
downloadrails-a08004a9a7d4c93c39f9693f6406ecb70d6a38c0.tar.gz
rails-a08004a9a7d4c93c39f9693f6406ecb70d6a38c0.tar.bz2
rails-a08004a9a7d4c93c39f9693f6406ecb70d6a38c0.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/base_test.rb15
-rw-r--r--actionpack/test/template/form_helper_test.rb9
2 files changed, 23 insertions, 1 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index 8416754c1e..b28717597e 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -52,7 +52,7 @@ class DefaultUrlOptionsController < ActionController::Base
def default_url_options_action
end
- def default_url_options(options)
+ def default_url_options(options = nil)
{ :host => 'www.override.com', :action => 'new', :bacon => 'chunky' }
end
end
@@ -167,4 +167,17 @@ class DefaultUrlOptionsTest < Test::Unit::TestCase
ensure
ActionController::Routing::Routes.load!
end
+end
+
+class EnsureNamedRoutesWorksTicket22BugTest < Test::Unit::TestCase
+ def test_named_routes_still_work
+ ActionController::Routing::Routes.draw do |map|
+ map.resources :things
+ end
+ EmptyController.send :include, ActionController::UrlWriter
+
+ assert_equal '/things', EmptyController.new.send(:things_path)
+ ensure
+ ActionController::Routing::Routes.load!
+ end
end \ No newline at end of file
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 204575fd89..4538b6dc6f 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -6,6 +6,7 @@ silence_warnings do
alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
+ alias_method :secret?, :secret
def new_record=(boolean)
@new_record = boolean
@@ -71,10 +72,12 @@ class FormHelperTest < ActionView::TestCase
'<label class="title_label" for="post_title">Title</label>',
label("post", "title", nil, :class => 'title_label')
)
+ assert_dom_equal('<label for="post_secret">Secret?</label>', label("post", "secret?"))
end
def test_label_with_symbols
assert_dom_equal('<label for="post_title">Title</label>', label(:post, :title))
+ assert_dom_equal('<label for="post_secret">Secret?</label>', label(:post, :secret?))
end
def test_label_with_for_attribute_as_symbol
@@ -140,6 +143,8 @@ class FormHelperTest < ActionView::TestCase
def test_hidden_field
assert_dom_equal '<input id="post_title" name="post[title]" type="hidden" value="Hello World" />',
hidden_field("post", "title")
+ assert_dom_equal '<input id="post_secret" name="post[secret]" type="hidden" value="1" />',
+ hidden_field("post", "secret?")
end
def test_hidden_field_with_escapes
@@ -172,6 +177,10 @@ class FormHelperTest < ActionView::TestCase
'<input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" /><input name="post[secret]" type="hidden" value="0" />',
check_box("post", "secret")
)
+ assert_dom_equal(
+ '<input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" /><input name="post[secret]" type="hidden" value="0" />',
+ check_box("post", "secret?")
+ )
end
def test_check_box_with_explicit_checked_and_unchecked_values