aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-02-10 17:11:53 -0500
committerJon Moss <me@jonathanmoss.me>2016-02-22 20:45:36 -0500
commit1813b29fc7632959800252f36e4b2e6ed4ac7266 (patch)
tree6ec6ea3e813be72f421716b70af8c0b09c7229c3 /railties/test/generators
parent063e81691933fd244fe04b362bc66b58250c0c64 (diff)
downloadrails-1813b29fc7632959800252f36e4b2e6ed4ac7266.tar.gz
rails-1813b29fc7632959800252f36e4b2e6ed4ac7266.tar.bz2
rails-1813b29fc7632959800252f36e4b2e6ed4ac7266.zip
Generate ApplicationRecord if it does not already exist
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/model_generator_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index c8c8f0aa3b..ed6846abc3 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -6,6 +6,14 @@ class ModelGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
arguments %w(Account name:string age:integer)
+ def test_application_record_skeleton_is_created
+ run_generator
+ assert_file "app/models/application_record.rb" do |record|
+ assert_match(/class ApplicationRecord < ActiveRecord::Base/, record)
+ assert_match(/self.abstract_class = true/, record)
+ end
+ end
+
def test_help_shows_invoked_generators_options
content = run_generator ["--help"]
assert_match(/ActiveRecord options:/, content)