cucumber_scaffold 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,239 +36,164 @@ Then run the cucumber_scaffold generator with the same parameters:
36
36
  [stakeholder]
37
37
  wants [behaviour]
38
38
 
39
- @index
40
39
  Scenario: List all posts
41
40
  Given the following posts:
42
- | name | body | rating | published |
43
- | name 1 | body 1 | 11 | true |
44
- | name 2 | body 2 | 12 | true |
45
- | name 3 | body 3 | 13 | true |
41
+ | name | body | rating | published |
42
+ | name 1 | body 1 | 11 | true |
43
+ | name 2 | body 2 | 12 | true |
44
+ | name 3 | body 3 | 13 | true |
46
45
  When I go to the posts page
47
46
  Then I should see the following posts:
48
- | Name | Body | Rating | Published |
49
- | name 1 | body 1 | 11 | true |
50
- | name 2 | body 2 | 12 | true |
51
- | name 3 | body 3 | 13 | true |
47
+ | Name | Body | Rating | Published |
48
+ | name 1 | body 1 | 11 | true |
49
+ | name 2 | body 2 | 12 | true |
50
+ | name 3 | body 3 | 13 | true |
51
+ And the heading should be "Listing posts"
52
52
 
53
- @show
54
53
  Scenario: View a post
55
- Given the following post:
56
- | name | name 10 |
57
- | body | body 10 |
58
- | rating | 20 |
59
- | published | true |
60
- When I go to the page for that post
54
+ Given the following posts:
55
+ | name | body | rating | published |
56
+ | name 1 | body 1 | 11 | true |
57
+ | name 2 | body 2 | 12 | true |
58
+ | name 3 | body 3 | 13 | true |
59
+ When I go to the posts page
60
+ And I click "Show" in the 2nd row
61
61
  Then I should see the following post:
62
- | Name: | name 10 |
63
- | Body: | body 10 |
64
- | Rating: | 20 |
65
- | Published: | true |
62
+ | Name: | name 2 |
63
+ | Body: | body 2 |
64
+ | Rating: | 12 |
65
+ | Published: | true |
66
+ When I follow "Back"
67
+ Then I should be on the posts page
66
68
 
67
- @edit
68
69
  Scenario: Edit a post
69
70
  Given the following post:
70
- | name | name 10 |
71
- | body | body 10 |
72
- | rating | 20 |
73
- | published | true |
74
- When I go to the edit page for that post
71
+ | name | name 10 |
72
+ | body | body 10 |
73
+ | rating | 20 |
74
+ | published | true |
75
+ When I go to the page for that post
76
+ And I follow "Edit"
75
77
  Then I should see the following form field values:
76
- | Name | name 10 |
77
- | Body | body 10 |
78
- | Rating | 20 |
79
- | Published | [x] |
78
+ | Name | name 10 |
79
+ | Body | body 10 |
80
+ | Rating | 20 |
81
+ | Published | [x] |
82
+ Then the heading should be "Editing post"
83
+ When I follow "Show"
84
+ Then I should be on the page for that post
80
85
 
81
- @index @destroy
82
86
  Scenario: Delete a post via the index page
83
87
  Given the following posts:
84
- | name | body | rating | published |
85
- | name 1 | body 1 | 11 | true |
86
- | name 2 | body 2 | 12 | true |
87
- | name 3 | body 3 | 13 | true |
88
+ | name | body | rating | published |
89
+ | name 1 | body 1 | 11 | true |
90
+ | name 2 | body 2 | 12 | true |
91
+ | name 3 | body 3 | 13 | true |
88
92
  When I go to the posts page
89
93
  And I click "Destroy" in the 2nd row
90
94
  Then I should see the following posts:
91
- | Name | Body | Rating | Published |
92
- | name 1 | body 1 | 11 | true |
93
- | name 3 | body 3 | 13 | true |
95
+ | Name | Body | Rating | Published |
96
+ | name 1 | body 1 | 11 | true |
97
+ | name 3 | body 3 | 13 | true |
94
98
  And I should be on the posts page
95
-
96
99
 
97
- @new @create @show
100
+ Scenario: New post page
101
+ Given I am on the posts page
102
+ When I follow "New Post"
103
+ Then I should be on the new post page
104
+ When I follow "Back"
105
+ Then I should be on the posts page
106
+
98
107
  Scenario: Create a new post
99
108
  Pending
100
109
  # Given I am on the new post page
101
110
  # When I fill in the form with:
102
- # | Name | name 10 |
103
- # | Body | body 10 |
104
- # | Rating | 20 |
105
- # | Published | [x] |
111
+ # | Name | name 10 |
112
+ # | Body | body 10 |
113
+ # | Rating | 20 |
114
+ # | Published | [x] |
106
115
  # And I press "Create"
107
116
  # Then I should see "Post was successfully created."
108
117
  # And I should see the following post:
109
- # | Name: | name 10 |
110
- # | Body: | body 10 |
111
- # | Rating: | 20 |
112
- # | Published: | true |
113
- #
114
- # In order to confirm that the user is redirected to the correct page
115
- # after create, you'll need to add an entry to paths.rb to uniquely
116
- # find a post, e.g.:
117
- #
118
- # when /page for the post with name "([^"]*)"$/
119
- # conditions = { :conditions => {:name => $1} }
120
- # matches = Post.all(conditions)
121
- # if matches.size == 0
122
- # raise "Could not find any posts using criteria #{conditions.inspect}"
123
- # elsif matches.size > 1
124
- # raise "Could not find a unique post using criteria #{conditions.inspect} (#{matches.size} matches)"
125
- # end
126
- # post_path(matches.first)
127
- #
128
- # Then add a step such as this to the scenario:
129
- #
130
- # And I should be on the page for the post with name "..."
118
+ # | Name: | name 10 |
119
+ # | Body: | body 10 |
120
+ # | Rating: | 20 |
121
+ # | Published: | true |
131
122
 
132
- @new @create
133
123
  Scenario: Attempt to create a new post with invalid input
134
124
  Pending
135
125
  # You should use this scenario as the basis for scenarios involving ActiveRecord validations, or delete it if it's not required
136
126
  # Given I am on the new post page
137
127
  # When I fill in the form with:
138
- # | Name | name 10 |
139
- # | Body | body 10 |
140
- # | Rating | 20 |
141
- # | Published | [x] |
128
+ # | Name | name 10 |
129
+ # | Body | body 10 |
130
+ # | Rating | 20 |
131
+ # | Published | [x] |
142
132
  # And I press "Create"
143
- # Then I should see "prohibited this post from being saved:"
133
+ # Then I should see "1 error prohibited this post from being saved:"
144
134
  #
145
135
  # [You should add checks for specific errors here. It may be appropriate to add extra scenarios.]
146
136
  #
147
137
  # And I should see the following form field values:
148
- # | Name | name 10 |
149
- # | Body | body 10 |
150
- # | Rating | 20 |
151
- # | Published | [x] |
138
+ # | Name | name 10 |
139
+ # | Body | body 10 |
140
+ # | Rating | 20 |
141
+ # | Published | [x] |
152
142
 
153
- @edit @update
154
143
  Scenario: Attempt to update a post with invalid input
155
144
  Pending
156
145
  # You should use this scenario as the basis for scenarios involving ActiveRecord validations, or delete it if it's not required
157
146
  # Given a post exists
158
147
  # When I go to the edit page for that post
159
148
  # And I fill in the form with:
160
- # | Name | name 10 |
161
- # | Body | body 10 |
162
- # | Rating | 20 |
163
- # | Published | [x] |
149
+ # | Name | name 10 |
150
+ # | Body | body 10 |
151
+ # | Rating | 20 |
152
+ # | Published | [x] |
164
153
  # And I press "Update"
165
- # Then I should see "prohibited this post from being saved:"
154
+ # Then I should see "1 error prohibited this post from being saved:"
166
155
  #
167
156
  # [You should add checks for specific errors here. It may be appropriate to add extra scenarios.]
168
157
  #
169
158
  # And I should see the following form field values:
170
- # | Name | name 10 |
171
- # | Body | body 10 |
172
- # | Rating | 20 |
173
- # | Published | [x] |
159
+ # | Name | name 10 |
160
+ # | Body | body 10 |
161
+ # | Rating | 20 |
162
+ # | Published | [x] |
174
163
 
175
- @edit @update @show
176
164
  Scenario: Update a post
177
165
  Given the following post:
178
- | name | name 10 |
179
- | body | body 10 |
180
- | rating | 20 |
181
- | published | true |
166
+ | name | name 10 |
167
+ | body | body 10 |
168
+ | rating | 20 |
169
+ | published | true |
182
170
  When I go to the edit page for that post
183
171
  And I fill in the form with:
184
- | Name | name 10 updated |
185
- | Body | body 10 updated |
186
- | Rating | -20 |
187
- | Published | [ ] |
172
+ | Name | name 10 updated |
173
+ | Body | body 10 updated |
174
+ | Rating | -20 |
175
+ | Published | [ ] |
188
176
  And I press "Update"
189
177
  Then I should be on the page for that post
190
178
  And I should see "Post was successfully updated."
191
179
  And I should see the following post:
192
- | Name: | name 10 updated |
193
- | Body: | body 10 updated |
194
- | Rating: | -20 |
195
- | Published: | false |
196
-
197
- @index @new
198
- Scenario: Navigate from the posts page to the new post page
199
- Given I am on the posts page
200
- When I follow "New Post"
201
- Then I should be on the new post page
180
+ | Name: | name 10 updated |
181
+ | Body: | body 10 updated |
182
+ | Rating: | -20 |
183
+ | Published: | false |
202
184
 
203
- @index @show
204
- Scenario: Navigate from posts page to the show post page
205
- Given the following posts:
206
- | name | body | rating | published |
207
- | name 1 | body 1 | 11 | true |
208
- | name 2 | body 2 | 12 | true |
209
- | name 3 | body 3 | 13 | true |
210
- When I go to the posts page
211
- And I click "Show" in the 2nd row
212
- Then I should be on the page for the 2nd post
213
-
214
- @index @edit
215
185
  Scenario: Navigate from posts page to the edit post page
216
186
  Given the following posts:
217
- | name | body | rating | published |
218
- | name 1 | body 1 | 11 | true |
219
- | name 2 | body 2 | 12 | true |
220
- | name 3 | body 3 | 13 | true |
187
+ | name | body | rating | published |
188
+ | name 1 | body 1 | 11 | true |
189
+ | name 2 | body 2 | 12 | true |
190
+ | name 3 | body 3 | 13 | true |
221
191
  When I go to the posts page
222
192
  And I click "Edit" in the 2nd row
223
193
  Then I should be on the edit page for the 2nd post
224
194
 
225
- @new @index
226
- Scenario: Navigate from new post page to posts page
227
- Given I am on the new post page
228
- When I follow "Back"
229
- Then I should be on the posts page
230
-
231
- @edit @show
232
- Scenario: Navigate from the edit post page to the show post page
233
- Given a post exists
234
- When I go to the edit page for that post
235
- And I follow "Show"
236
- Then I should be on the page for that post
237
-
238
- @edit @index
239
195
  Scenario: Navigate from edit post page to the posts page
240
196
  Given a post exists
241
197
  When I go to the edit page for that post
242
198
  And I follow "Back"
243
199
  Then I should be on the posts page
244
-
245
- @show @edit
246
- Scenario: Navigate from show post page to edit post page
247
- Given a post exists
248
- When I go to the page for that post
249
- And I follow "Edit"
250
- Then I should be on the edit page for that post
251
-
252
- @show @index
253
- Scenario: Navigate from show post page to posts page
254
- Given a post exists
255
- And I am on the page for that post
256
- And I follow "Back"
257
- Then I should be on the posts page
258
-
259
- @index
260
- Scenario: Posts page title
261
- When I go to the posts page
262
- Then the heading should be "Listing posts"
263
-
264
- @new
265
- Scenario: New post page title
266
- When I go to the new post page
267
- Then the heading should be "New post"
268
-
269
- @edit
270
- Scenario: Edit post page title
271
- Given a post exists
272
- When I go to the edit page for that post
273
- Then the heading should be "Editing post"
274
-
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('cucumber_scaffold', '0.1.4') do |p|
5
+ Echoe.new('cucumber_scaffold', '0.1.5') do |p|
6
6
  p.description = "Generate scaffolding for Cucumber features and steps definitions"
7
7
  p.url = "http://github.com/andyw8/cucumber_scaffold"
8
8
  p.author = "Andy Waite"
data/TODO CHANGED
@@ -3,10 +3,9 @@
3
3
  * Test with Formtastic
4
4
  * Test with inherited_resources
5
5
  * Test with with inherited_resources_views
6
- * Add support for booleans (checkboxes)
7
6
  * Add support for date/time fields
8
- * Add support for belongs_to associations
9
- * Test for model names containing more than one word (e.g. DocumentCategory)
7
+ * Add better support for belongs_to associations (references)
10
8
  * Add automated test suite
11
9
  * Prevent excess whitespace in generated files
10
+ * Add support for nifty_generators scaffolding
12
11
  * Better interaction with Pickle
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cucumber_scaffold}
5
- s.version = "0.1.4"
5
+ s.version = "0.1.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Andy Waite"]
9
- s.date = %q{2010-11-13}
9
+ s.date = %q{2010-11-14}
10
10
  s.description = %q{Generate scaffolding for Cucumber features and steps definitions}
11
11
  s.email = %q{andy@andywaite.com}
12
12
  s.extra_rdoc_files = ["README.rdoc", "TODO", "lib/generators/cucumber_scaffold/feature/USAGE", "lib/generators/cucumber_scaffold/feature/feature_generator.rb", "lib/generators/cucumber_scaffold/feature/templates/feature.feature", "lib/generators/cucumber_scaffold/feature/templates/steps.rb", "lib/generators/cucumber_scaffold/install/USAGE", "lib/generators/cucumber_scaffold/install/install_generator.rb", "lib/generators/cucumber_scaffold/install/templates/step_definitions/web_steps_additional.rb", "lib/generators/cucumber_scaffold/install/templates/support/table_helpers.rb"]
@@ -29,6 +29,7 @@ module CucumberScaffold
29
29
 
30
30
  extra_paths = <<EOF
31
31
  when /edit page for that #{singular.humanize.downcase}/
32
+ raise 'no #{singular.humanize.downcase}' unless @#{singular}
32
33
  edit_#{singular}_path(@#{singular})
33
34
  when /page for that #{singular.humanize.downcase}/
34
35
  raise 'no #{singular.humanize.downcase}' unless @#{singular}
@@ -93,27 +94,35 @@ EOF
93
94
  @attributes.each do |pair|
94
95
  attribute_name = pair.first[0]
95
96
  attribute_type = pair.first[1]
96
- default_value = default_value(:attribute_name => attribute_name, :attribute_type => attribute_type, :updated => options[:updated])
97
+ default_value = default_value(:attribute_name => attribute_name, :attribute_type => attribute_type, :updated => options[:updated], :index => options[:index])
97
98
 
98
99
  lines << "| #{attribute_name.humanize}: | #{default_value} |"
99
100
  end
100
101
  lines.join(options[:commented] ? LINE_BREAK_WITH_INDENT_COMMENTED : LINE_BREAK_WITH_INDENT)
101
102
  end
102
103
 
103
- def form_single_resource_commented
104
- form_single_resource(:commented => true)
105
- end
106
-
107
- def html_single_resource_commented
108
- html_single_resource(:commented => true)
109
- end
110
-
111
104
  def form_single_resource(options = {})
112
105
  lines = []
113
106
  @attributes.each do |pair|
114
107
  attribute_name = pair.first[0]
115
108
  attribute_type = pair.first[1]
116
- lines << "| #{attribute_name.humanize} | #{default_value(:attribute_name => attribute_name, :attribute_type => attribute_type, :updated => options[:updated], :form => true)} |"
109
+
110
+ if options[:blank]
111
+ if attribute_type == 'boolean'
112
+ value = '[ ]'
113
+ else
114
+ value = ''
115
+ end
116
+ else
117
+ value = default_value(
118
+ :attribute_name => attribute_name,
119
+ :attribute_type => attribute_type,
120
+ :updated => options[:updated],
121
+ :form => true,
122
+ :index => options[:index])
123
+ end
124
+
125
+ lines << "| #{attribute_name.humanize} | #{value} |"
117
126
  end
118
127
  result = lines.join(options[:commented] ? LINE_BREAK_WITH_INDENT_COMMENTED : LINE_BREAK_WITH_INDENT)
119
128
  end
@@ -142,18 +151,6 @@ EOF
142
151
  activerecord_table_row(:index => 3)].join(LINE_BREAK_WITH_INDENT)
143
152
  end
144
153
 
145
- def activerecord_single_resource_updated
146
- activerecord_single_resource(:updated => true)
147
- end
148
-
149
- def form_single_resource_updated
150
- form_single_resource(:updated => true)
151
- end
152
-
153
- def html_single_resource_updated
154
- html_single_resource(:updated => true)
155
- end
156
-
157
154
  def default_value(options={})
158
155
  options[:index] ||= 10
159
156
 
@@ -200,10 +197,6 @@ EOF
200
197
  activerecord_table_row(options)
201
198
  end
202
199
 
203
- def tags(tags)
204
- tags
205
- end
206
-
207
200
  def make_row(data)
208
201
  "| #{data.join(' | ')} |"
209
202
  end
@@ -25,7 +25,7 @@ else
25
25
  edit_heading = "Editing #{singular}"
26
26
  new_heading = "New #{singular}"
27
27
  back_to_all = 'Back'
28
- problems_intro = "prohibited this #{singular} from being saved:"
28
+ problems_intro = "1 error prohibited this #{singular} from being saved:"
29
29
  end
30
30
 
31
31
  pending_explanation_1 = "You should use this scenario as the basis for scenarios involving ActiveRecord validations, or delete it if it's not required"
@@ -37,7 +37,6 @@ Feature: Manage <%= plural_title.humanize.downcase %>
37
37
  [stakeholder]
38
38
  wants [behaviour]
39
39
 
40
- <%= tags('@index') %>
41
40
  Scenario: List all <%= plural.humanize.downcase %>
42
41
  Given the following <%= plural.humanize.downcase %>:
43
42
  <%= activerecord_table_header_row %>
@@ -49,25 +48,49 @@ Feature: Manage <%= plural_title.humanize.downcase %>
49
48
  <%= html_table_header_row %>
50
49
  <%= html_table_row(:index => 1) %>
51
50
  <%= html_table_row(:index => 2) %>
52
- <%= html_table_row(:index => 3) %>
51
+ <%= html_table_row(:index => 3) %>
52
+ And the heading should be "<%= index_heading %>"
53
+ <% if index_title %>
54
+ And the title should be "<%= index_title %>"
55
+ <% end %>
53
56
 
54
- <%= tags('@show') %>
55
57
  Scenario: View a <%= singular.humanize.downcase %>
56
- Given the following <%= singular.humanize.downcase %>:
57
- <%= activerecord_single_resource %>
58
- When I go to the page for that <%= singular.humanize.downcase %>
58
+ Given the following <%= plural.humanize.downcase %>:
59
+ <%= activerecord_table_header_row %>
60
+ <%= activerecord_table_row(:index => 1) %>
61
+ <%= activerecord_table_row(:index => 2) %>
62
+ <%= activerecord_table_row(:index => 3) %>
63
+ When I go to the <%= plural.humanize.downcase %> page
64
+ And I click "Show" in the 2nd row
59
65
  Then I should see the following <%= singular.humanize.downcase %>:
60
- <%= html_single_resource %>
66
+ <%= html_single_resource(:index => 2) %>
67
+ <% if show_heading -%>
68
+ And the heading should be "<%= show_heading %>"
69
+ <% end -%>
70
+ <% if index_title -%>
71
+ And the title should be "<%= show_title %>"
72
+ <% end -%>
73
+ <% if nifty? %>
74
+ When I follow "View All"
75
+ <% else %>
76
+ When I follow "Back"
77
+ <% end %>
78
+ Then I should be on the <%= plural.humanize.downcase %> page
61
79
 
62
- <%= tags('@edit') %>
63
80
  Scenario: Edit a <%= singular.humanize.downcase %>
64
81
  Given the following <%= singular.humanize.downcase %>:
65
82
  <%= activerecord_single_resource %>
66
- When I go to the edit page for that <%= singular.humanize.downcase %>
83
+ When I go to the page for that <%= singular.humanize.downcase %>
84
+ And I follow "Edit"
67
85
  Then I should see the following form field values:
68
86
  <%= form_single_resource %>
87
+ Then the heading should be "<%= edit_heading %>"
88
+ <% if index_title %>
89
+ And the title should be "<%= edit_title %>"
90
+ <% end %>
91
+ When I follow "Show"
92
+ Then I should be on the page for that <%= singular.humanize.downcase %>
69
93
 
70
- <%= tags('@index @destroy') %>
71
94
  Scenario: Delete a <%= singular.humanize.downcase %> via the index page
72
95
  Given the following <%= plural.humanize.downcase %>:
73
96
  <%= activerecord_table_header_row %>
@@ -86,7 +109,6 @@ Feature: Manage <%= plural_title.humanize.downcase %>
86
109
  <% end -%>
87
110
 
88
111
  <% if nifty? %>
89
- <%= tags('@show @destroy @index') %>
90
112
  Scenario: Delete a <%= singular.humanize.downcase %> via the show page
91
113
  Given the following <%= plural.humanize.downcase %>:
92
114
  <%= activerecord_table_header_row %>
@@ -103,97 +125,67 @@ Feature: Manage <%= plural_title.humanize.downcase %>
103
125
  And I should see "<%= successful_destroy_message %>"
104
126
  <% end -%>
105
127
 
106
- <%= tags('@new @create @show') %>
128
+ Scenario: New <%= singular.humanize.downcase %> page
129
+ Given I am on the <%= plural.humanize.downcase %> page
130
+ When I follow "New <%= singular_title %>"
131
+ Then I should be on the new <%= singular.humanize.downcase %> page
132
+ <% if new_title %>
133
+ And the title should be "<%= new_title %>"
134
+ <% end %>
135
+ When I follow "<%= back_to_all %>"
136
+ Then I should be on the <%= plural.humanize.downcase %> page
137
+
107
138
  Scenario: Create a new <%= singular.humanize.downcase %>
108
139
  Pending
109
140
  # Given I am on the new <%= singular.humanize.downcase %> page
110
141
  # When I fill in the form with:
111
- # <%= form_single_resource_commented %>
142
+ # <%= form_single_resource(:commented => true) %>
112
143
  # And I press "<%= create_button_title %>"
113
144
  # Then I should see "<%= successful_create_message %>"
114
145
  # And I should see the following <%= singular.humanize.downcase %>:
115
- # <%= html_single_resource_commented %>
116
- #
117
- # In order to confirm that the user is redirected to the correct page
118
- # after create, you'll need to add an entry to paths.rb to uniquely
119
- # find a <%= singular.humanize.downcase %>, e.g.:
120
- #
121
- # when /page for the <%= singular.humanize.downcase %> with name "([^"]*)"$/
122
- # conditions = { :conditions => {:name => $1} }
123
- # matches = <%= singular.camelcase %>.all(conditions)
124
- # if matches.size == 0
125
- # raise "Could not find any <%= plural.humanize.downcase %> using criteria #{conditions.inspect}"
126
- # elsif matches.size > 1
127
- # raise "Could not find a unique <%= singular.humanize.downcase %> using criteria #{conditions.inspect} (#{matches.size} matches)"
128
- # end
129
- # <%= singular %>_path(matches.first)
130
- #
131
- # Then add a step such as this to the scenario:
132
- #
133
- # And I should be on the page for the <%= singular.humanize.downcase %> with name "..."
146
+ # <%= html_single_resource(:commented => true) %>
134
147
 
135
- <%= tags('@new @create') %>
136
148
  Scenario: Attempt to create a new <%= singular.humanize.downcase %> with invalid input
137
149
  Pending
138
150
  # <%= pending_explanation_1 %>
139
151
  # Given I am on the new <%= singular.humanize.downcase %> page
140
152
  # When I fill in the form with:
141
- # <%= form_single_resource_commented %>
153
+ # <%= form_single_resource(:commented => true) %>
142
154
  # And I press "<%= create_button_title %>"
143
155
  # Then I should see "<%= problems_intro %>"
144
156
  #
145
157
  # <%= pending_explanation_2 %>
146
158
  #
147
159
  # And I should see the following form field values:
148
- # <%= form_single_resource_commented %>
160
+ # <%= form_single_resource(:commented => true) %>
149
161
 
150
- <%= tags('@edit @update') %>
151
162
  Scenario: Attempt to update a <%= singular.humanize.downcase %> with invalid input
152
163
  Pending
153
164
  # <%= pending_explanation_1 %>
154
165
  # Given a <%= singular.humanize.downcase %> exists
155
166
  # When I go to the edit page for that <%= singular.humanize.downcase %>
156
167
  # And I fill in the form with:
157
- # <%= form_single_resource_commented %>
168
+ # <%= form_single_resource(:commented => true) %>
158
169
  # And I press "<%= update_button_title %>"
159
170
  # Then I should see "<%= problems_intro %>"
160
171
  #
161
172
  # <%= pending_explanation_2 %>
162
173
  #
163
174
  # And I should see the following form field values:
164
- # <%= form_single_resource_commented %>
175
+ # <%= form_single_resource(:commented => true) %>
165
176
 
166
- <%= tags('@edit @update @show') %>
167
177
  Scenario: Update a <%= singular.humanize.downcase %>
168
178
  Given the following <%= singular.humanize.downcase %>:
169
179
  <%= activerecord_single_resource %>
170
180
  When I go to the edit page for that <%= singular.humanize.downcase %>
171
181
  And I fill in the form with:
172
- <%= form_single_resource_updated %>
182
+ <%= form_single_resource(:updated => true) %>
173
183
  And I press "<%= update_button_title %>"
174
184
  Then I should be on the page for that <%= singular.humanize.downcase %>
175
185
  And I should see "<%= successful_update_message %>"
176
186
  And I should see the following <%= singular.humanize.downcase %>:
177
- <%= html_single_resource_updated %>
178
-
179
- <%= tags('@index @new') %>
180
- Scenario: Navigate from the <%= plural.humanize.downcase %> page to the new <%= singular.humanize.downcase %> page
181
- Given I am on the <%= plural.humanize.downcase %> page
182
- When I follow "New <%= singular_title %>"
183
- Then I should be on the new <%= singular.humanize.downcase %> page
184
-
185
- <%= tags('@index @show') %>
186
- Scenario: Navigate from <%= plural.humanize.downcase %> page to the show <%= singular.humanize.downcase %> page
187
- Given the following <%= plural.humanize.downcase %>:
188
- <%= activerecord_table_header_row %>
189
- <%= activerecord_table_row(:index => 1) %>
190
- <%= activerecord_table_row(:index => 2) %>
191
- <%= activerecord_table_row(:index => 3) %>
192
- When I go to the <%= plural.humanize.downcase %> page
193
- And I click "Show" in the 2nd row
194
- Then I should be on the page for the 2nd <%= singular.humanize.downcase %>
187
+ <%= html_single_resource(:updated => true) %>
195
188
 
196
- <%= tags('@index @edit') %>
197
189
  Scenario: Navigate from <%= plural.humanize.downcase %> page to the edit <%= singular.humanize.downcase %> page
198
190
  Given the following <%= plural.humanize.downcase %>:
199
191
  <%= activerecord_table_header_row %>
@@ -204,78 +196,8 @@ Feature: Manage <%= plural_title.humanize.downcase %>
204
196
  And I click "Edit" in the 2nd row
205
197
  Then I should be on the edit page for the 2nd <%= singular.humanize.downcase %>
206
198
 
207
- <%= tags('@new @index') %>
208
- Scenario: Navigate from new <%= singular.humanize.downcase %> page to <%= plural.humanize.downcase %> page
209
- Given I am on the new <%= singular.humanize.downcase %> page
210
- When I follow "<%= back_to_all %>"
211
- Then I should be on the <%= plural.humanize.downcase %> page
212
-
213
- <%= tags('@edit @show') %>
214
- Scenario: Navigate from the edit <%= singular.humanize.downcase %> page to the show <%= singular.humanize.downcase %> page
215
- Given a <%= singular.humanize.downcase %> exists
216
- When I go to the edit page for that <%= singular.humanize.downcase %>
217
- And I follow "Show"
218
- Then I should be on the page for that <%= singular.humanize.downcase %>
219
-
220
- <%= tags('@edit @index') %>
221
199
  Scenario: Navigate from edit <%= singular.humanize.downcase %> page to the <%= plural.humanize.downcase %> page
222
200
  Given a <%= singular.humanize.downcase %> exists
223
201
  When I go to the edit page for that <%= singular.humanize.downcase %>
224
202
  And I follow "<%= back_to_all %>"
225
- Then I should be on the <%= plural.humanize.downcase %> page
226
-
227
- <%= tags('@show @edit') %>
228
- Scenario: Navigate from show <%= singular.humanize.downcase %> page to edit <%= singular.humanize.downcase %> page
229
- Given a <%= singular.humanize.downcase %> exists
230
- When I go to the page for that <%= singular.humanize.downcase %>
231
- And I follow "Edit"
232
- Then I should be on the edit page for that <%= singular.humanize.downcase %>
233
-
234
- <%= tags('@show @index') %>
235
- Scenario: Navigate from show <%= singular.humanize.downcase %> page to <%= plural.humanize.downcase %> page
236
- Given a <%= singular.humanize.downcase %> exists
237
- When I go to the page for that <%= singular.humanize.downcase %>
238
- <% if nifty? %>
239
- And I follow "View All"
240
- <% else %>
241
- And I follow "Back"
242
- <% end %>
243
- Then I should be on the <%= plural.humanize.downcase %> page
244
-
245
- <%= tags('@index') %>
246
- Scenario: <%= plural_title %> page title
247
- When I go to the <%= plural.humanize.downcase %> page
248
- Then the heading should be "<%= index_heading %>"
249
- <% if index_title %>
250
- And the title should be "<%= index_title %>"
251
- <% end -%>
252
-
253
- <% if show_heading || index_title %>
254
- <%= tags('@show') %>
255
- Scenario: <%= singular_title %> page title
256
- Given a <%= singular.humanize.downcase %> exists
257
- When I go to the page for that <%= singular %>
258
- <% if show_heading -%>
259
- Then the heading should be "<%= show_heading %>"
260
- <% end -%>
261
- <% if index_title -%>
262
- And the title should be "<%= show_title %>"
263
- <% end -%>
264
- <% end -%>
265
-
266
- <%= tags('@new') %>
267
- Scenario: New <%= singular.humanize.downcase %> page title
268
- When I go to the new <%= singular.humanize.downcase %> page
269
- Then the heading should be "<%= new_heading %>"
270
- <% if index_title %>
271
- And the title should be "<%= new_title %>"
272
- <% end -%>
273
-
274
- <%= tags('@edit') %>
275
- Scenario: Edit <%= singular.humanize.downcase %> page title
276
- Given a <%= singular.humanize.downcase %> exists
277
- When I go to the edit page for that <%= singular.humanize.downcase %>
278
- Then the heading should be "<%= edit_heading %>"
279
- <% if index_title %>
280
- And the title should be "<%= edit_title %>"
281
- <% end %>
203
+ Then I should be on the <%= plural.humanize.downcase %> page
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Waite
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-13 00:00:00 +00:00
18
+ date: 2010-11-14 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21