aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-26 10:14:40 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-26 10:14:40 -0800
commitbf3ddfa28da8ca837ddce8c6744a6c1fd9a51243 (patch)
treec96839ac99bcf2142939a728b56116679bf0f909 /railties/test
parente5e440f477a0b5e06b008ee77e3c635049405957 (diff)
parent3225898513434ded93fe3abe51ba700f5bd9db84 (diff)
downloadrails-bf3ddfa28da8ca837ddce8c6744a6c1fd9a51243.tar.gz
rails-bf3ddfa28da8ca837ddce8c6744a6c1fd9a51243.tar.bz2
rails-bf3ddfa28da8ca837ddce8c6744a6c1fd9a51243.zip
Merge branch 'master' into adequaterecord
* master: (55 commits) [ci skip] Move association class method notes extract common code in `uuid_test.rb`. move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`. [ci skip] remove guide section on models in migrations test case for custom PostgreSQL enum type. Remove inclusion of rubysl gem for rbx on generated Gemfile let `insert_record` actuall save the object. [skip ci] Fix test name typo in app generator tests. travis s/2.1.0/2.1.1 Bump version of bcrypt gem Skip test_migrate_revert_add_index_with_name if databases do not allow to create duplicate indexes on the same columns Optimize getting started guide images, and use png instead of jpg :scissors: [ci skip] Point master changelogs to 4-1-stable branch Add missing parantheses in index_exists? `ActionDispatch::Head` was replaced by `Rack::Head`. Closes #14191. [skip ci] Standardized punctuation. [skip ci] Fix typo in link_to :method option description refactor, with_locale is not needed because I18n is mocked. Fix ActionView label translation for more than 10 nested elements ...
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb15
-rw-r--r--railties/test/generators/app_generator_test.rb7
-rw-r--r--railties/test/generators/model_generator_test.rb7
-rw-r--r--railties/test/generators/resource_generator_test.rb2
4 files changed, 9 insertions, 22 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index b2d0e7e202..b39cd3747b 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -762,7 +762,7 @@ module ApplicationTests
end
end
- test "lookup config.log_level with custom logger (stdlib Logger)" do
+ test "config.log_level with custom logger" do
make_basic_app do |app|
app.config.logger = Logger.new(STDOUT)
app.config.log_level = :info
@@ -770,19 +770,6 @@ module ApplicationTests
assert_equal Logger::INFO, Rails.logger.level
end
- test "assign log_level as is with custom logger (third party logger)" do
- logger_class = Class.new do
- attr_accessor :level
- end
- logger_instance = logger_class.new
- make_basic_app do |app|
- app.config.logger = logger_instance
- app.config.log_level = :info
- end
- assert_equal logger_instance, Rails.logger
- assert_equal :info, Rails.logger.level
- end
-
test "respond_to? accepts include_private" do
make_basic_app
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 5811379e35..5ebdadacbf 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -265,13 +265,6 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
- def test_inclusion_of_plateform_dependent_gems
- run_generator([destination_root])
- if RUBY_ENGINE == 'rbx'
- assert_gem 'rubysl'
- end
- end
-
def test_jquery_is_the_default_javascript_library
run_generator
assert_file "app/assets/javascripts/application.js" do |contents|
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index 01ab77ee20..bdf51b457c 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -34,6 +34,13 @@ class ModelGeneratorTest < Rails::Generators::TestCase
assert_no_migration "db/migrate/create_accounts.rb"
end
+ def test_plural_names_are_singularized
+ content = run_generator ["accounts".freeze]
+ assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
+ assert_file "test/models/account_test.rb", /class AccountTest/
+ assert_match(/The model name 'accounts' was recognized as a plural, using the singular 'account'\. Override with --force-plural or setup custom inflection rules for this noun before running the generator\./, content)
+ end
+
def test_model_with_underscored_parent_option
run_generator ["account", "--parent", "admin/account"]
assert_file "app/models/account.rb", /class Account < Admin::Account/
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb
index 3d4e694361..55c8d92ee8 100644
--- a/railties/test/generators/resource_generator_test.rb
+++ b/railties/test/generators/resource_generator_test.rb
@@ -63,7 +63,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
content = run_generator ["accounts".freeze]
assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
assert_file "test/models/account_test.rb", /class AccountTest/
- assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural./, content)
+ assert_match(/The model name 'accounts' was recognized as a plural, using the singular 'account'\. 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