diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2014-11-04 13:20:22 +0000 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2014-11-04 13:20:22 +0000 |
commit | 9887a2cfe52f30d4a91e0d16fe57ecf96537b98c (patch) | |
tree | eab3c5a32eebd6e913b3960ac8b9c7f927264c56 /railties/test | |
parent | 70177618afd704884e669454173456e41411f136 (diff) | |
parent | b670fadb978c8a12c3414ed842cd49e4fde2cec0 (diff) | |
download | rails-9887a2cfe52f30d4a91e0d16fe57ecf96537b98c.tar.gz rails-9887a2cfe52f30d4a91e0d16fe57ecf96537b98c.tar.bz2 rails-9887a2cfe52f30d4a91e0d16fe57ecf96537b98c.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/middleware/exceptions_test.rb | 15 | ||||
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 10 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 7 |
3 files changed, 28 insertions, 4 deletions
diff --git a/railties/test/application/middleware/exceptions_test.rb b/railties/test/application/middleware/exceptions_test.rb index 42096cfec4..a7472b37f1 100644 --- a/railties/test/application/middleware/exceptions_test.rb +++ b/railties/test/application/middleware/exceptions_test.rb @@ -60,6 +60,21 @@ module ApplicationTests assert_equal "YOU FAILED BRO", last_response.body end + test "url generation error when action_dispatch.show_exceptions is set raises an exception" do + controller :foo, <<-RUBY + class FooController < ActionController::Base + def index + raise ActionController::UrlGenerationError + end + end + RUBY + + app.config.action_dispatch.show_exceptions = true + + get '/foo' + assert_equal 500, last_response.status + end + test "unspecified route when action_dispatch.show_exceptions is not set raises an exception" do app.config.action_dispatch.show_exceptions = false diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 267469b6f5..524c70aad2 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -109,6 +109,16 @@ module ApplicationTests db_fixtures_load database_url_db_name end + test 'db:fixtures:load with namespaced fixture' do + require "#{app_path}/config/environment" + Dir.chdir(app_path) do + `rails generate model admin::book title:string; + bundle exec rake db:migrate db:fixtures:load` + require "#{app_path}/app/models/admin/book" + assert_equal 2, Admin::Book.count + end + end + def db_structure_dump_and_load(expected_database) Dir.chdir(app_path) do `rails generate model book title:string; diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index b492258efb..b7cbe04003 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -450,12 +450,11 @@ class AppGeneratorTest < Rails::Generators::TestCase end end - def test_generator_if_skip_gems_is_given - run_generator [destination_root, "--skip-gems", "turbolinks", "coffee-rails"] + def test_generator_if_skip_turbolinks_is_given + run_generator [destination_root, "--skip-turbolinks"] assert_file "Gemfile" do |content| assert_no_match(/turbolinks/, content) - assert_no_match(/coffee-rails/, content) end assert_file "app/views/layouts/application.html.erb" do |content| assert_no_match(/data-turbolinks-track/, content) @@ -491,7 +490,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_psych_gem run_generator - gem_regex = /gem 'psych',\s+'~> 2.0', \s+platforms: :rbx/ + gem_regex = /gem 'psych',\s+'~> 2.0',\s+platforms: :rbx/ assert_file "Gemfile" do |content| if defined?(Rubinius) |