diff options
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/assets_test.rb | 2 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 16 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 7e9a9a5f3b..5f3b364f97 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -410,7 +410,7 @@ module ApplicationTests precompile! - assert_equal "Post;\n", File.read(Dir["#{app_path}/public/assets/application-*.js"].first) + assert_match(/Post;/, File.read(Dir["#{app_path}/public/assets/application-*.js"].first)) end test "initialization on the assets group should set assets_dir" do diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 87e28288ee..50d343865c 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -229,6 +229,7 @@ module ApplicationTests test "the application can be eager loaded even when there are no frameworks" do FileUtils.rm_rf("#{app_path}/app/models/application_record.rb") + FileUtils.rm_rf("#{app_path}/app/mailers/application_mailer.rb") FileUtils.rm_rf("#{app_path}/config/environments") add_to_config <<-RUBY config.eager_load = true @@ -1307,6 +1308,21 @@ module ApplicationTests assert_equal 'custom key', Rails.application.config.my_custom_config['key'] end + test "config_for use the Pathname object if it is provided" do + app_file 'config/custom.yml', <<-RUBY + development: + key: 'custom key' + RUBY + + add_to_config <<-RUBY + config.my_custom_config = config_for(Pathname.new(Rails.root.join("config/custom.yml"))) + RUBY + + app 'development' + + assert_equal 'custom key', Rails.application.config.my_custom_config['key'] + end + test "config_for raises an exception if the file does not exist" do add_to_config <<-RUBY config.my_custom_config = config_for('custom') diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 6373c7b42b..c8fb9fbc67 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -98,7 +98,7 @@ module ApplicationTests end def test_code_statistics_sanity - assert_match "Code LOC: 10 Test LOC: 0 Code to Test Ratio: 1:0.0", + assert_match "Code LOC: 14 Test LOC: 0 Code to Test Ratio: 1:0.0", Dir.chdir(app_path){ `bin/rake stats` } end |