Skip to content

Commit a6c5cc2

Browse files
committed
Added missing assert to test checking form with namespaced isolated model and fixed helpers to work correctly in such case
1 parent cd27cd5 commit a6c5cc2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

actionpack/lib/action_controller/record_identifier.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module RecordIdentifier
4040
# dom_class(post, :edit) # => "edit_post"
4141
# dom_class(Person, :edit) # => "edit_person"
4242
def dom_class(record_or_class, prefix = nil)
43-
singular = ActiveModel::Naming.singular(record_or_class)
43+
singular = ActiveModel::Naming.param_key(record_or_class)
4444
prefix ? "#{prefix}#{JOIN}#{singular}" : singular
4545
end
4646

actionpack/test/template/form_helper_test.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,13 @@ def test_form_for_with_isolated_namespaced_model
696696
concat f.submit('Edit post')
697697
end
698698

699-
expected =
700-
"<form accept-charset='UTF-8' action='/posts/44' method='post'>" +
701-
snowman +
702-
"<label for='post_title'>The Title</label>" +
699+
expected = whole_form("/posts/44", "edit_post_44" , "edit_post", :method => "put") do
703700
"<input name='post[title]' size='30' type='text' id='post_title' value='And his name will be forty and four.' />" +
704-
"<input name='commit' id='post_submit' type='submit' value='Edit post' />" +
701+
"<input name='commit' type='submit' value='Edit post' />" +
705702
"</form>"
703+
end
704+
705+
assert_dom_equal expected, output_buffer
706706
end
707707

708708
def test_form_for_with_symbol_object_name

0 commit comments

Comments
 (0)