Skip to content
This repository
Browse code

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

…odel and fixed helpers to work correctly in such case
  • Loading branch information...
commit a6c5cc2377cbc478cecde7e419c41de5f06ec4e1 1 parent cd27cd5
Piotr Sarnacki drogus authored
2  actionpack/lib/action_controller/record_identifier.rb
@@ -40,7 +40,7 @@ module RecordIdentifier
40 40 # dom_class(post, :edit) # => "edit_post"
41 41 # dom_class(Person, :edit) # => "edit_person"
42 42 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)
44 44 prefix ? "#{prefix}#{JOIN}#{singular}" : singular
45 45 end
46 46
10 actionpack/test/template/form_helper_test.rb
@@ -696,13 +696,13 @@ def test_form_for_with_isolated_namespaced_model
696 696 concat f.submit('Edit post')
697 697 end
698 698
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
703 700 "<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' />" +
705 702 "</form>"
  703 + end
  704 +
  705 + assert_dom_equal expected, output_buffer
706 706 end
707 707
708 708 def test_form_for_with_symbol_object_name

0 comments on commit a6c5cc2

Please sign in to comment.
Something went wrong with that request. Please try again.