aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-12 18:20:14 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-12 18:20:14 -0300
commit495daef06141706c363df3d42ca1683706f85735 (patch)
tree9d9da820873d4caa77937e6405992ce56b18e179 /actionview/test
parent212fcd51f9f2f5bf70782b1011e8238f8d9bdbb4 (diff)
parente18f045b6518d555f14ac84f39aa4177ea51185d (diff)
downloadrails-495daef06141706c363df3d42ca1683706f85735.tar.gz
rails-495daef06141706c363df3d42ca1683706f85735.tar.bz2
rails-495daef06141706c363df3d42ca1683706f85735.zip
Merge pull request #12112 from adamniedzielski/fix-form-for-namespace-and-as
form_for - fix :namespace and :as options clash Conflicts: actionview/CHANGELOG.md
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/form_helper_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb
index 8cca43d7ca..944884c9dd 100644
--- a/actionview/test/template/form_helper_test.rb
+++ b/actionview/test/template/form_helper_test.rb
@@ -1681,6 +1681,18 @@ class FormHelperTest < ActionView::TestCase
assert_dom_equal expected, output_buffer
end
+ def test_form_for_with_namespace_and_as_option
+ form_for(@post, namespace: 'namespace', as: 'custom_name') do |f|
+ concat f.text_field(:title)
+ end
+
+ expected = whole_form('/posts/123', 'namespace_edit_custom_name', 'edit_custom_name', method: 'patch') do
+ "<input id='namespace_custom_name_title' name='custom_name[title]' type='text' value='Hello World' />"
+ end
+
+ assert_dom_equal expected, output_buffer
+ end
+
def test_two_form_for_with_namespace
form_for(@post, namespace: 'namespace_1') do |f|
concat f.label(:title)