diff options
-rw-r--r-- | Gemfile | 25 | ||||
-rw-r--r-- | Gemfile.lock | 105 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 7 | ||||
-rw-r--r-- | actionpack/test/assertions/response_assertions_test.rb | 24 | ||||
-rw-r--r-- | activemodel/lib/active_model/dirty.rb | 2 | ||||
-rw-r--r-- | guides/bug_report_templates/active_record_migrations_gem.rb | 65 | ||||
-rw-r--r-- | guides/bug_report_templates/active_record_migrations_master.rb | 64 | ||||
-rw-r--r-- | guides/source/contributing_to_ruby_on_rails.md | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/puma.rb | 15 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 5 |
13 files changed, 239 insertions, 80 deletions
@@ -1,5 +1,10 @@ source "https://rubygems.org" +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end + gemspec # We need a newish Rake since Active Job sets its test tasks' descriptions. @@ -25,10 +30,10 @@ gem "bcrypt", "~> 3.1.11", require: false gem "uglifier", ">= 1.3.0", require: false # Track stable branch of sass because it doesn't have circular require warnings. -gem "sass", git: "https://github.com/sass/sass", branch: "stable", require: false +gem "sass", github: "sass/sass", branch: "stable", require: false # FIXME: Remove this fork after https://github.com/nex3/rb-inotify/pull/49 is fixed. -gem "rb-inotify", git: "https://github.com/matthewd/rb-inotify", branch: "close-handling", require: false +gem "rb-inotify", github: "matthewd/rb-inotify", branch: "close-handling", require: false group :doc do gem "sdoc", "~> 0.4.0" @@ -43,19 +48,19 @@ gem "listen", "~> 3.0.5", require: false # Active Job. group :job do - gem "resque", git: "https://github.com/resque/resque", require: false + gem "resque", github: "resque/resque", require: false gem "resque-scheduler", require: false gem "sidekiq", require: false gem "sucker_punch", require: false - gem "delayed_job", require: false, git: "https://github.com/collectiveidea/delayed_job" - gem "queue_classic", git: "https://github.com/QueueClassic/queue_classic", branch: "master", require: false, platforms: :ruby + gem "delayed_job", require: false, github: "collectiveidea/delayed_job" + gem "queue_classic", github: "QueueClassic/queue_classic", branch: "master", require: false, platforms: :ruby gem "sneakers", require: false gem "que", require: false gem "backburner", require: false #TODO: add qu after it support Rails 5.1 # gem 'qu-rails', github: "bkeepers/qu", branch: "master", require: false gem "qu-redis", require: false - gem "delayed_job_active_record", require: false, git: "https://github.com/collectiveidea/delayed_job_active_record" + gem "delayed_job_active_record", require: false, github: "collectiveidea/delayed_job_active_record" gem "sequel", require: false end @@ -109,10 +114,10 @@ end platforms :jruby do if ENV["AR_JDBC"] - gem "activerecord-jdbcsqlite3-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "master" + gem "activerecord-jdbcsqlite3-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master" group :db do - gem "activerecord-jdbcmysql-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "master" - gem "activerecord-jdbcpostgresql-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "master" + gem "activerecord-jdbcmysql-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master" + gem "activerecord-jdbcpostgresql-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master" end else gem "activerecord-jdbcsqlite3-adapter", ">= 1.3.0" @@ -134,7 +139,7 @@ if ENV["ORACLE_ENHANCED"] platforms :ruby do gem "ruby-oci8", "~> 2.2" end - gem "activerecord-oracle_enhanced-adapter", git: "https://github.com/rsim/oracle-enhanced", branch: "master" + gem "activerecord-oracle_enhanced-adapter", github: "rsim/oracle-enhanced", branch: "master" end # A gem necessary for Active Record tests with IBM DB. diff --git a/Gemfile.lock b/Gemfile.lock index c42815d915..9e4c989edd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,28 +1,28 @@ GIT - remote: https://github.com/QueueClassic/queue_classic - revision: c26f2c9f6f6133b946fbcdd7b7ec905a4aca9f94 + remote: https://github.com/QueueClassic/queue_classic.git + revision: 1ef197b9db8149a895e59077badcb5b94d4c8b44 branch: master specs: queue_classic (3.2.0.RC1) pg (>= 0.17, < 0.19) GIT - remote: https://github.com/collectiveidea/delayed_job - revision: 71f1d5faf934d3057abca942f0d410327bc69087 + remote: https://github.com/collectiveidea/delayed_job.git + revision: e3772d4f0c8470d0fcba00c86ca3bc4f5e876830 specs: - delayed_job (4.1.1) + delayed_job (4.1.2) activesupport (>= 3.0, < 5.1) GIT - remote: https://github.com/collectiveidea/delayed_job_active_record - revision: 61e688e03b2ef4004b08de6d1e0a123fda8fffad + remote: https://github.com/collectiveidea/delayed_job_active_record.git + revision: 36f434c4fd660e8f11ce932be117e9c71dde7212 specs: - delayed_job_active_record (4.1.0) + delayed_job_active_record (4.1.1) activerecord (>= 3.0, < 5.1) delayed_job (>= 3.0, < 5) GIT - remote: https://github.com/matthewd/rb-inotify + remote: https://github.com/matthewd/rb-inotify.git revision: 90553518d1fb79aedc98a3036c59bd2b6731ac40 branch: close-handling specs: @@ -30,8 +30,8 @@ GIT ffi (>= 0.5.0) GIT - remote: https://github.com/resque/resque - revision: 06036388ec61e573c761ac5a25a2ef3c76537ec7 + remote: https://github.com/resque/resque.git + revision: a3a66389618b830de0e6acf862b0dc9fde05cf49 specs: resque (1.27.0) mono_logger (~> 1.0) @@ -41,8 +41,8 @@ GIT vegas (~> 0.1.2) GIT - remote: https://github.com/sass/sass - revision: 3fda1cbe70d615e7ef96e28db4fd1f8a3ebb5505 + remote: https://github.com/sass/sass.git + revision: 7716e67f3507c6f65878c69aa49ec358ebf675c7 branch: stable specs: sass (3.4.22) @@ -111,7 +111,7 @@ GEM specs: addressable (2.4.0) amq-protocol (2.0.1) - arel (7.1.1) + arel (7.1.2) backburner (1.3.0) beaneater (~> 1.0) dante (> 0.1.5) @@ -119,7 +119,7 @@ GEM bcrypt (3.1.11-x64-mingw32) bcrypt (3.1.11-x86-mingw32) beaneater (1.0.0) - benchmark-ips (2.6.1) + benchmark-ips (2.7.2) blade (0.5.6) activesupport (>= 3.0.0) blade-qunit_adapter (~> 1.20.0) @@ -134,14 +134,14 @@ GEM thor (~> 0.19.1) useragent (~> 0.16.7) blade-qunit_adapter (1.20.0) - blade-sauce_labs_plugin (0.5.2) + blade-sauce_labs_plugin (0.5.3) childprocess faraday selenium-webdriver builder (3.2.2) bunny (2.2.2) amq-protocol (>= 2.0.1) - byebug (8.2.5) + byebug (9.0.5) childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) coffee-rails (4.2.1) @@ -153,17 +153,17 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) connection_pool (2.2.0) - cookiejar (0.3.0) + cookiejar (0.3.3) curses (1.0.2) - daemons (1.2.3) + daemons (1.2.4) dalli (2.7.6) dante (0.2.0) em-hiredis (0.3.1) eventmachine (~> 1.0) hiredis (~> 0.6.0) - em-http-request (1.1.3) + em-http-request (1.1.5) addressable (>= 2.3.4) - cookiejar (<= 0.3.0) + cookiejar (!= 0.3.1) em-socksify (>= 0.3) eventmachine (>= 1.0.3) http_parser.rb (>= 0.6.0) @@ -187,15 +187,13 @@ GEM faye-websocket (0.10.4) eventmachine (>= 0.12.0) websocket-driver (>= 0.5.1) - ffi (1.9.10) - ffi (1.9.10-x64-mingw32) - ffi (1.9.10-x86-mingw32) - globalid (0.3.6) + ffi (1.9.14) + globalid (0.3.7) activesupport (>= 4.1.0) hiredis (0.6.1) http_parser.rb (0.6.0) i18n (0.7.0) - jquery-rails (4.1.1) + jquery-rails (4.2.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -203,18 +201,18 @@ GEM kindlerb (0.1.1) mustache nokogiri - listen (3.0.7) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) metaclass (0.0.4) method_source (0.8.2) - mime-types (3.0) + mime-types (3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0221) + mime-types-data (3.2016.0521) mini_portile2 (2.1.0) minitest (5.3.3) mocha (0.14.0) @@ -240,42 +238,44 @@ GEM pg (0.18.4-x64-mingw32) pg (0.18.4-x86-mingw32) pkg-config (1.1.7) - psych (2.1.0) - puma (3.4.0) + psych (2.1.1) + puma (3.6.0) qu (0.2.0) multi_json qu-redis (0.2.0) qu (= 0.2.0) redis-namespace simple_uuid - que (0.11.4) + que (0.12.0) racc (1.4.14) rack (2.0.1) rack-cache (1.6.1) rack (>= 0.4) + rack-protection (1.5.3) + rack rack-test (0.6.3) rack (>= 1.0) - rails-dom-testing (2.0.0) + rails-dom-testing (2.0.1) activesupport (>= 4.2.0, < 6.0) nokogiri (~> 1.6.0) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - rake (11.1.2) + rake (11.2.2) rb-fsevent (0.9.7) rdoc (4.2.2) json (~> 1.4) redcarpet (3.2.3) - redis (3.3.0) + redis (3.3.1) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) - resque-scheduler (4.2.0) + resque-scheduler (4.3.0) mono_logger (~> 1.0) - redis (~> 3.0) - resque (~> 1.25) + redis (~> 3.3) + resque (~> 1.26) rufus-scheduler (~> 3.2) rubyzip (1.2.0) - rufus-scheduler (3.2.1) - sass-rails (5.0.5) + rufus-scheduler (3.2.2) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -284,16 +284,17 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - selenium-webdriver (2.53.0) + selenium-webdriver (2.53.4) childprocess (~> 0.5) rubyzip (~> 1.0) websocket (~> 1.0) - sequel (4.34.0) + sequel (4.38.0) serverengine (1.5.11) sigdump (~> 0.2.2) - sidekiq (4.1.2) + sidekiq (4.2.0) concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.0) + rack-protection (~> 1.5) redis (~> 3.2, >= 3.2.1) sigdump (0.2.4) simple_uuid (0.4.0) @@ -304,11 +305,11 @@ GEM serverengine (~> 1.5.11) thor thread (~> 0.1.7) - sprockets (3.6.1) + sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-export (0.9.1) - sprockets-rails (3.1.1) + sprockets-rails (3.2.0) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) @@ -326,16 +327,16 @@ GEM thread (0.1.7) thread_safe (0.3.5) tilt (2.0.5) - turbolinks (5.0.0) + turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.0) tzinfo (1.2.2) thread_safe (~> 0.1) - tzinfo-data (1.2016.4) + tzinfo-data (1.2016.6) tzinfo (>= 1.0.0) - uglifier (3.0.0) + uglifier (3.0.2) execjs (>= 0.3.0, < 3) - useragent (0.16.7) + useragent (0.16.8) vegas (0.1.11) rack (>= 1.0.0) w3c_validators (1.2) @@ -408,4 +409,4 @@ DEPENDENCIES wdm (>= 0.1.0) BUNDLED WITH - 1.12.5 + 1.13.1 diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 46ddf48926..f8f91ed41c 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -90,7 +90,7 @@ module ActionController render as `text/plain`, `render html: '<strong>HTML</strong>'` to render as `text/html`, or `render body: 'raw'` to match the deprecated behavior and render with the default Content-Type, which is - `text/plain`. + `text/html`. WARNING end diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index a00602ed70..a2eaccd9ef 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -79,7 +79,12 @@ module ActionDispatch def generate_response_message(expected, actual = @response.response_code) "Expected response to be a <#{code_with_name(expected)}>,"\ " but was a <#{code_with_name(actual)}>" - .concat location_if_redirected + .concat(location_if_redirected).concat(response_body_if_short) + end + + def response_body_if_short + return "" if @response.body.size > 500 + "\nResponse body: #{@response.body}" end def location_if_redirected diff --git a/actionpack/test/assertions/response_assertions_test.rb b/actionpack/test/assertions/response_assertions_test.rb index 17517f8965..14a04ccdb1 100644 --- a/actionpack/test/assertions/response_assertions_test.rb +++ b/actionpack/test/assertions/response_assertions_test.rb @@ -6,10 +6,11 @@ module ActionDispatch class ResponseAssertionsTest < ActiveSupport::TestCase include ResponseAssertions - FakeResponse = Struct.new(:response_code, :location) do + FakeResponse = Struct.new(:response_code, :location, :body) do def initialize(*) super self.location ||= "http://test.example.com/posts" + self.body ||= "" end [:successful, :not_found, :redirection, :server_error].each do |sym| @@ -112,6 +113,27 @@ module ActionDispatch " redirect to <http://test.host/posts/redirect/2>" assert_match expected, error.message end + + def test_error_message_shows_short_response_body + @response = ActionDispatch::Response.new + @response.status = 400 + @response.body = "not too long" + error = assert_raises(Minitest::Assertion) { assert_response 200 } + expected = "Expected response to be a <200: OK>,"\ + " but was a <400: Bad Request>" \ + "\nResponse body: not too long" + assert_match expected, error.message + end + + def test_error_message_does_not_show_long_response_body + @response = ActionDispatch::Response.new + @response.status = 400 + @response.body = "not too long" * 50 + error = assert_raises(Minitest::Assertion) { assert_response 200 } + expected = "Expected response to be a <200: OK>,"\ + " but was a <400: Bad Request>" + assert_match expected, error.message + end end end end diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index f87973301b..a8df7522ff 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -58,7 +58,7 @@ module ActiveModel # # A newly instantiated +Person+ object is unchanged: # - # person = Person.new("Uncle Bob") + # person = Person.new # person.changed? # => false # # Change the name: diff --git a/guides/bug_report_templates/active_record_migrations_gem.rb b/guides/bug_report_templates/active_record_migrations_gem.rb new file mode 100644 index 0000000000..f568a111f6 --- /dev/null +++ b/guides/bug_report_templates/active_record_migrations_gem.rb @@ -0,0 +1,65 @@ +begin + require "bundler/inline" +rescue LoadError => e + $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" + raise e +end + +gemfile(true) do + source "https://rubygems.org" + # Activate the gem you are reporting the issue against. + gem "activerecord", "5.0.0.1" + gem "sqlite3" +end + +require "active_record" +require "minitest/autorun" +require "logger" + +# Ensure backward compatibility with Minitest 4 +Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) + +# This connection will do for database-independent bug reports. +ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") +ActiveRecord::Base.logger = Logger.new(STDOUT) + +ActiveRecord::Schema.define do + create_table :payments, force: true do |t| + t.decimal :amount, precision: 10, scale: 0, default: 0, null: false + end +end + +class Payment < ActiveRecord::Base +end + +class ChangeAmountToAddScale < ActiveRecord::Migration[5.0] + def change + reversible do |dir| + dir.up do + change_column :payments, :amount, :decimal, precision: 10, scale: 2, default: 0, null: false + end + + dir.down do + change_column :payments, :amount, :decimal, precision: 10, scale: 0, default: 0, null: false + end + end + end +end + +class BugTest < Minitest::Test + def test_migration_up + migrator = ActiveRecord::Migrator.new(:up, [ChangeAmountToAddScale]) + migrator.run + Payment.reset_column_information + + assert_equal "decimal(10,2)", Payment.columns.last.sql_type + end + + def test_migration_down + migrator = ActiveRecord::Migrator.new(:down, [ChangeAmountToAddScale]) + migrator.run + Payment.reset_column_information + + assert_equal "decimal(10,0)", Payment.columns.last.sql_type + end +end
\ No newline at end of file diff --git a/guides/bug_report_templates/active_record_migrations_master.rb b/guides/bug_report_templates/active_record_migrations_master.rb new file mode 100644 index 0000000000..ef7b42e0a6 --- /dev/null +++ b/guides/bug_report_templates/active_record_migrations_master.rb @@ -0,0 +1,64 @@ +begin + require "bundler/inline" +rescue LoadError => e + $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" + raise e +end + +gemfile(true) do + source "https://rubygems.org" + gem "rails", github: "rails/rails" + gem "sqlite3" +end + +require "active_record" +require "minitest/autorun" +require "logger" + +# Ensure backward compatibility with Minitest 4 +Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) + +# This connection will do for database-independent bug reports. +ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") +ActiveRecord::Base.logger = Logger.new(STDOUT) + +ActiveRecord::Schema.define do + create_table :payments, force: true do |t| + t.decimal :amount, precision: 10, scale: 0, default: 0, null: false + end +end + +class Payment < ActiveRecord::Base +end + +class ChangeAmountToAddScale < ActiveRecord::Migration[5.0] + def change + reversible do |dir| + dir.up do + change_column :payments, :amount, :decimal, precision: 10, scale: 2, default: 0, null: false + end + + dir.down do + change_column :payments, :amount, :decimal, precision: 10, scale: 0, default: 0, null: false + end + end + end +end + +class BugTest < Minitest::Test + def test_migration_up + migrator = ActiveRecord::Migrator.new(:up, [ChangeAmountToAddScale]) + migrator.run + Payment.reset_column_information + + assert_equal "decimal(10,2)", Payment.columns.last.sql_type + end + + def test_migration_down + migrator = ActiveRecord::Migrator.new(:down, [ChangeAmountToAddScale]) + migrator.run + Payment.reset_column_information + + assert_equal "decimal(10,0)", Payment.columns.last.sql_type + end +end
\ No newline at end of file diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index 5df16e68c9..4f938f5deb 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -40,6 +40,7 @@ Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, th Having a way to reproduce your issue will be very helpful for others to help confirm, investigate and ultimately fix your issue. You can do this by providing an executable test case. To make this process easier, we have prepared several bug report templates for you to use as a starting point: * Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) +* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_master.rb) * Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb) * Template for Active Job issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_master.rb) * Generic template for other issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb) diff --git a/railties/lib/rails/generators/rails/app/templates/config/puma.rb b/railties/lib/rails/generators/rails/app/templates/config/puma.rb index a44bfbabec..7ee948002e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/puma.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/puma.rb @@ -32,6 +32,14 @@ environment ENV.fetch("RAILS_ENV") { "development" } # # preload_app! +# If you are preloading your application and using Active Record, it's +# recommended that you close any connections to the database before workers +# are forked to prevent connection leakage. +# +# before_fork do +# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) +# end + # The code in the `on_worker_boot` will be called if you are using # clustered mode by specifying a number of `workers`. After each worker # process is booted this block will be run, if you are using `preload_app!` @@ -43,13 +51,6 @@ environment ENV.fetch("RAILS_ENV") { "development" } # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) # end # -# If you are preloading your application and using ActiveRecord, it's -# recommended that you close any connections to the database before workers -# are forked to prevent connection leakage. -# -# before_fork do -# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) -# end # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index acab83799d..8f7fa1155f 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -606,7 +606,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_edge_option assert_generates_with_bundler edge: true - assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']#{Regexp.escape("5-0-stable")}["']$} + assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$} end def test_spring diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 0d8e6f8907..15079f2735 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -205,7 +205,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase def test_edge_option assert_generates_without_bundler(edge: true) - assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']#{Regexp.escape("5-0-stable")}["']$} + assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$} end def test_generation_does_not_run_bundle_install_with_full_and_mountable diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index b9b11504dc..8c1fe43a10 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -117,11 +117,6 @@ module TestHelpers end end - gemfile_path = "#{app_path}/Gemfile" - if options[:gemfile].blank? && File.exist?(gemfile_path) - File.delete gemfile_path - end - routes = File.read("#{app_path}/config/routes.rb") if routes =~ /(\n\s*end\s*)\Z/ File.open("#{app_path}/config/routes.rb", "w") do |f| |