aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/resource_generator_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-06-13 11:24:33 -0400
committerGitHub <noreply@github.com>2016-06-13 11:24:33 -0400
commita9734859ce3b07a27f58169ec85fe8e3fc4b20fd (patch)
treeddc804a7fda9b320f0075fde4e7e50b6f21d43e0 /railties/test/generators/resource_generator_test.rb
parent1efc81ba8fe27e406bdb2de104234253b47ddc2f (diff)
parentb991017bf1bfc2a9ca56f8b475f6f47b3ce99484 (diff)
downloadrails-a9734859ce3b07a27f58169ec85fe8e3fc4b20fd.tar.gz
rails-a9734859ce3b07a27f58169ec85fe8e3fc4b20fd.tar.bz2
rails-a9734859ce3b07a27f58169ec85fe8e3fc4b20fd.zip
Merge pull request #25319 from morgoth/generate-application-record-first
Generate application_record.rb file before model file
Diffstat (limited to 'railties/test/generators/resource_generator_test.rb')
-rw-r--r--railties/test/generators/resource_generator_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb
index addaf83bc8..53dcfc4024 100644
--- a/railties/test/generators/resource_generator_test.rb
+++ b/railties/test/generators/resource_generator_test.rb
@@ -60,14 +60,14 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
def test_plural_names_are_singularized
content = run_generator ["accounts".freeze]
- assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
+ assert_file "app/models/account.rb", /class Account < ApplicationRecord/
assert_file "test/models/account_test.rb", /class AccountTest/
assert_match(/\[WARNING\] The model name 'accounts' was recognized as a plural, using the singular 'account' instead\. Override with --force-plural or setup custom inflection rules for this noun before running the generator\./, content)
end
def test_plural_names_can_be_forced
content = run_generator ["accounts", "--force-plural"]
- assert_file "app/models/accounts.rb", /class Accounts < ActiveRecord::Base/
+ assert_file "app/models/accounts.rb", /class Accounts < ApplicationRecord/
assert_file "test/models/accounts_test.rb", /class AccountsTest/
assert_no_match(/\[WARNING\]/, content)
end