@@ -6,18 +6,19 @@ Feature: Edit Page
6
6
Given a category named "Music" exists
7
7
And a user named "John Doe" exists
8
8
And a post with the title "Hello World" written by "John Doe" exists
9
+ And a tag named "Bugs" exists
9
10
And I am logged in
10
- And a configuration of:
11
+
12
+ Scenario : Default form with no config
13
+ Given a configuration of:
11
14
"""
12
15
ActiveAdmin.register Post do
13
16
permit_params :custom_category_id, :author_id, :title,
14
17
:body, :position, :published_date, :starred
15
18
end
16
19
"""
17
20
When I am on the index page for posts
18
-
19
- Scenario : Default form with no config
20
- Given I follow "Edit"
21
+ And I follow "Edit"
21
22
Then the "Title" field should contain "Hello World"
22
23
And the "Body" field should contain ""
23
24
And the "Category" field should contain ""
@@ -47,6 +48,7 @@ Feature: Edit Page
47
48
end
48
49
end
49
50
"""
51
+ When I am on the index page for posts
50
52
And I follow "Edit"
51
53
Then I should see a fieldset titled "Your Post"
52
54
And I should see a fieldset titled "Publishing"
@@ -76,6 +78,7 @@ Feature: Edit Page
76
78
end
77
79
end
78
80
"""
81
+ When I am on the index page for posts
79
82
And I follow "New"
80
83
Then I follow "Posts"
81
84
And I follow "Edit"
@@ -107,6 +110,7 @@ Feature: Edit Page
107
110
form partial: "form"
108
111
end
109
112
"""
113
+ When I am on the index page for posts
110
114
And I follow "Edit"
111
115
Then the "Title" field should contain "Hello World"
112
116
And the "Body" field should contain ""
@@ -115,3 +119,20 @@ Feature: Edit Page
115
119
Then I should see "Post was successfully updated."
116
120
And I should see the attribute "Title" with "Hello World from update"
117
121
And I should see the attribute "Author" with "John Doe"
122
+
123
+ Scenario : Generating a custom form for Tag resource
124
+ Given a configuration of:
125
+ """
126
+ ActiveAdmin.register Tag do
127
+ form do |f|
128
+ f.inputs "Details" do
129
+ f.input :name
130
+ end
131
+ f.actions
132
+ end
133
+ end
134
+ """
135
+ When I am on the index page for tags
136
+ And I follow "Edit"
137
+ Then I should see a fieldset titled "Details"
138
+ And the "Name" field should contain "Bugs"
0 commit comments