Merge pull request #40745

This commit is contained in:
Rafael Mendonça França 2021-06-08 23:32:28 +00:00
commit babc9eae9d
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
3 changed files with 12 additions and 4 deletions

View File

@ -913,7 +913,7 @@ You can also run `bin/rails test:all` to run all tests, including system tests.
Now let's test the flow for creating a new article in our blog.
```ruby
test "creating an article" do
test "should create Article" do
visit articles_path
click_on "New Article"

View File

@ -1,3 +1,11 @@
* Modified scaffold generator template so that running
`rails g scaffold Author` no longer generates tests called "creating
a Author", "updating a Author", and "destroying a Author"
Fixes #40744.
*Michael Duchemin*
* Raise an error in generators if a field type is invalid.
*Petrik de Heus*

View File

@ -11,7 +11,7 @@ class <%= class_name.pluralize %>Test < ApplicationSystemTestCase
assert_selector "h1", text: "<%= class_name.pluralize.titleize %>"
end
test "creating a <%= human_name %>" do
test "should create <%= human_name %>" do
visit <%= plural_table_name %>_url
click_on "New <%= class_name.titleize %>"
@ -28,7 +28,7 @@ class <%= class_name.pluralize %>Test < ApplicationSystemTestCase
click_on "Back"
end
test "updating a <%= human_name %>" do
test "should update <%= human_name %>" do
visit <%= plural_table_name %>_url
click_on "Edit", match: :first
@ -45,7 +45,7 @@ class <%= class_name.pluralize %>Test < ApplicationSystemTestCase
click_on "Back"
end
test "destroying a <%= human_name %>" do
test "should destroy <%= human_name %>" do
visit <%= plural_table_name %>_url
page.accept_confirm do
click_on "Destroy", match: :first