File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
lib/active_admin/view_helpers Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,35 @@ Feature: Edit Page
5252 And I should see the attribute "Title" with "Hello World from update"
5353 And I should see the attribute "Author" with "John Doe"
5454
55+ Scenario : Generating a custom form with :html set, visiting the new page first (bug probing issue #109)
56+ Given a configuration of:
57+ """
58+ ActiveAdmin.register Post do
59+ form :html => {} do |f|
60+ f.inputs "Your Post" do
61+ f.input :title
62+ f.input :body
63+ end
64+ f.inputs "Publishing" do
65+ f.input :published_at
66+ end
67+ f.buttons
68+ end
69+ end
70+ """
71+ Given I follow "New"
72+ Then I follow "Posts"
73+ Then I follow "Edit"
74+ Then I should see a fieldset titled "Your Post"
75+ And I should see a fieldset titled "Publishing"
76+ And the "Title" field should contain "Hello World"
77+ And the "Body" field should contain ""
78+ When I fill in "Title" with "Hello World from update"
79+ When I press "Update Post"
80+ Then I should see "Post was successfully updated."
81+ And I should see the attribute "Title" with "Hello World from update"
82+ And I should see the attribute "Author" with "John Doe"
83+
5584 Scenario : Generating a form from a partial
5685 Given "app/views/admin/posts/_form.html.erb" contains:
5786 """
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module ViewHelpers
33 module FormHelper
44
55 def active_admin_form_for ( resource , options = { } , &block )
6+ options = Marshal . load ( Marshal . dump ( options ) )
67 options [ :builder ] ||= ActiveAdmin ::FormBuilder
78 semantic_form_for resource , options , &block
89 end
You can’t perform that action at this time.
0 commit comments