@@ -219,7 +219,7 @@ def test_generator_if_skip_active_record_is_given
219
assert_match ( /gem ["']actionmailer["']/ , gemfile_content )
219
assert_match ( /gem ["']actionmailer["']/ , gemfile_content )
220
assert_match ( /gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
220
assert_match ( /gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
221
end
221
end
222
- assert_file "config/application.rb" , /# \s +require\s +["']active_record \/ railtie ["']/
222
+ assert_file "config/application.rb" , /\s +require\s +["']rails \/ all ["']/
223
assert_file "config/application.rb" , /#\s +config\. active_record\. whitelist_attributes = true/
223
assert_file "config/application.rb" , /#\s +config\. active_record\. whitelist_attributes = true/
224
assert_file "config/application.rb" , /#\s +config\. active_record\. dependent_restrict_raises = false/
224
assert_file "config/application.rb" , /#\s +config\. active_record\. dependent_restrict_raises = false/
225
assert_file "test/test_helper.rb" do |helper_content |
225
assert_file "test/test_helper.rb" do |helper_content |
@@ -237,7 +237,7 @@ def test_generator_if_skip_action_mailer_is_given
237
assert_match ( /# gem ["']actionmailer["']/ , gemfile_content )
237
assert_match ( /# gem ["']actionmailer["']/ , gemfile_content )
238
assert_match ( /gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
238
assert_match ( /gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
239
end
239
end
240
- assert_file "config/application.rb" , /# \s +require\s +["']action_mailer \/ railtie ["']/
240
+ assert_file "config/application.rb" , /\s +require\s +["']rails \/ all ["']/
241
assert_file "config/environments/development.rb" do |content |
241
assert_file "config/environments/development.rb" do |content |
242
assert_no_match ( /config\. action_mailer\. raise_delivery_errors = false/ , content )
242
assert_no_match ( /config\. action_mailer\. raise_delivery_errors = false/ , content )
243
end
243
end
@@ -259,7 +259,7 @@ def test_generator_if_skip_sprockets_is_given
259
assert_match ( /# gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
259
assert_match ( /# gem ["']sprockets-rails["'], '~> 1\. 0'/ , gemfile_content )
260
end
260
end
261
assert_file "config/application.rb" do |content |
261
assert_file "config/application.rb" do |content |
262
- assert_match ( /# \s +require\s +["']sprockets \/ rails\/ railtie ["']/ , content )
262
+ assert_match ( /\s +require\s +["']rails\/ all ["']/ , content )
263
assert_no_match ( /config\. assets\. enabled = true/ , content )
263
assert_no_match ( /config\. assets\. enabled = true/ , content )
264
end
264
end
265
assert_file "Gemfile" do |content |
265
assert_file "Gemfile" do |content |
@@ -372,6 +372,18 @@ def test_no_active_record_or_test_unit_if_skips_given
372
assert_file "config/application.rb" , /#\s +require\s +["']active_record\/ railtie["']/
372
assert_file "config/application.rb" , /#\s +require\s +["']active_record\/ railtie["']/
373
end
373
end
374
374
375
+ def test_no_action_mailer_or_test_unit_if_skips_given
376
+ run_generator [ destination_root , "--skip-test-unit" , "--skip-action-mailer" ]
377
+ assert_file "config/application.rb" , /#\s +require\s +["']rails\/ test_unit\/ railtie["']/
378
+ assert_file "config/application.rb" , /#\s +require\s +["']action_mailer\/ railtie["']/
379
+ end
380
+
381
+ def test_no_sprockets_or_test_unit_if_skips_given
382
+ run_generator [ destination_root , "--skip-test-unit" , "--skip-sprockets" ]
383
+ assert_file "config/application.rb" , /#\s +require\s +["']rails\/ test_unit\/ railtie["']/
384
+ assert_file "config/application.rb" , /#\s +require\s +["']sprockets\/ rails\/ railtie["']/
385
+ end
386
+
375
def test_new_hash_style
387
def test_new_hash_style
376
run_generator [ destination_root ]
388
run_generator [ destination_root ]
377
assert_file "config/initializers/session_store.rb" do |file |
389
assert_file "config/initializers/session_store.rb" do |file |
0 commit comments