Browse files

Added missing assert to test checking form with namespaced isolated m…

…odel and fixed helpers to work correctly in such case
  • Loading branch information...
1 parent cd27cd5 commit a6c5cc2377cbc478cecde7e419c41de5f06ec4e1 @drogus drogus committed Jun 7, 2011
View
2 actionpack/lib/action_controller/record_identifier.rb
@@ -40,7 +40,7 @@ module RecordIdentifier
# dom_class(post, :edit) # => "edit_post"
# dom_class(Person, :edit) # => "edit_person"
def dom_class(record_or_class, prefix = nil)
- singular = ActiveModel::Naming.singular(record_or_class)
+ singular = ActiveModel::Naming.param_key(record_or_class)
prefix ? "#{prefix}#{JOIN}#{singular}" : singular
end
View
10 actionpack/test/template/form_helper_test.rb
@@ -696,13 +696,13 @@ def test_form_for_with_isolated_namespaced_model
concat f.submit('Edit post')
end
- expected =
- "<form accept-charset='UTF-8' action='/posts/44' method='post'>" +
- snowman +
- "<label for='post_title'>The Title</label>" +
+ expected = whole_form("/posts/44", "edit_post_44" , "edit_post", :method => "put") do
"<input name='post[title]' size='30' type='text' id='post_title' value='And his name will be forty and four.' />" +
- "<input name='commit' id='post_submit' type='submit' value='Edit post' />" +
+ "<input name='commit' type='submit' value='Edit post' />" +
"</form>"
+ end
+
+ assert_dom_equal expected, output_buffer
end
def test_form_for_with_symbol_object_name

0 comments on commit a6c5cc2

Please sign in to comment.