We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f0212f commit d98ec7aCopy full SHA for d98ec7a
example_app_generator/generate_stuff.rb
@@ -167,4 +167,17 @@ def using_source_path(path)
167
gsub_file 'spec/controllers/uploads_controller_spec.rb',
168
'skip("Add a hash of attributes valid for your model")',
169
'{}'
170
+
171
+# adds validation to widget so our test for happy and unhappy path will be ready to test validation
172
+gsub_file 'spec/requests/widgets_spec.rb',
173
+ 'skip("Add a hash of attributes invalid for your model")',
174
+ '{ name: "" }'
175
176
177
+ 'skip("Add a hash of attributes valid for your model")',
178
+ '{ name: "lorem" }'
179
180
+gsub_file 'app/models/widget.rb',
181
+ 'end',
182
+ 'validates :name, presence: true; end'
183
final_tasks
0 commit comments