aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionview/test/actionpack/controller/render_test.rb15
-rw-r--r--actionview/test/template/date_helper_test.rb6
-rw-r--r--activerecord/test/cases/migration_test.rb6
-rw-r--r--activerecord/test/cases/numeric_data_test.rb14
-rw-r--r--activerecord/test/migrations/decimal/1_give_me_big_numbers.rb2
-rw-r--r--activerecord/test/schema/schema.rb2
-rw-r--r--railties/test/commands/routes_test.rb39
7 files changed, 35 insertions, 49 deletions
diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb
index 8a9d7982d3..e059f37d38 100644
--- a/actionview/test/actionpack/controller/render_test.rb
+++ b/actionview/test/actionpack/controller/render_test.rb
@@ -4,10 +4,6 @@ require "abstract_unit"
require "active_model"
require "controller/fake_models"
-class ApplicationController < ActionController::Base
- self.view_paths = File.join(FIXTURE_LOAD_PATH, "actionpack")
-end
-
module Quiz
# Models
Question = Struct.new(:name, :id) do
@@ -20,7 +16,7 @@ module Quiz
end
# Controller
- class QuestionsController < ApplicationController
+ class QuestionsController < ActionController::Base
def new
render partial: Quiz::Question.new("Namespaced Partial")
end
@@ -28,7 +24,7 @@ module Quiz
end
module Fun
- class GamesController < ApplicationController
+ class GamesController < ActionController::Base
def hello_world; end
def nested_partial_with_form_builder
@@ -37,7 +33,7 @@ module Fun
end
end
-class TestController < ApplicationController
+class TestController < ActionController::Base
protect_from_forgery
before_action :set_variable_for_layout
@@ -640,10 +636,15 @@ class RenderTest < ActionController::TestCase
ActionView::Base.logger = ActiveSupport::Logger.new(nil)
@request.host = "www.nextangle.com"
+
+ @old_view_paths = ActionController::Base.view_paths
+ ActionController::Base.view_paths = File.join(FIXTURE_LOAD_PATH, "actionpack")
end
def teardown
ActionView::Base.logger = nil
+
+ ActionController::Base.view_paths = @old_view_paths
end
# :ported:
diff --git a/actionview/test/template/date_helper_test.rb b/actionview/test/template/date_helper_test.rb
index 94357d5f90..4b4939d705 100644
--- a/actionview/test/template/date_helper_test.rb
+++ b/actionview/test/template/date_helper_test.rb
@@ -141,10 +141,10 @@ class DateHelperTest < ActionView::TestCase
end
def test_distance_in_words_doesnt_use_the_quotient_operator
- rubinius_skip "Date is written in Ruby and relies on Fixnum#/"
- jruby_skip "Date is written in Ruby and relies on Fixnum#/"
+ rubinius_skip "Date is written in Ruby and relies on Integer#/"
+ jruby_skip "Date is written in Ruby and relies on Integer#/"
- # Make sure that we avoid {Integer,Fixnum}#/ (redefined by mathn)
+ # Make sure that we avoid Integer#/ (redefined by mathn)
Integer.send :private, :/
from = Time.utc(2004, 6, 6, 21, 45, 0)
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index c241ddc807..f77a275544 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -177,7 +177,7 @@ class MigrationTest < ActiveRecord::TestCase
assert BigNumber.create(
bank_balance: 1586.43,
big_bank_balance: BigDecimal("1000234000567.95"),
- world_population: 6000000000,
+ world_population: 2**62,
my_house_population: 3,
value_of_e: BigDecimal("2.7182818284590452353602875")
)
@@ -191,10 +191,8 @@ class MigrationTest < ActiveRecord::TestCase
assert_not_nil b.my_house_population
assert_not_nil b.value_of_e
- # TODO: set world_population >= 2**62 to cover 64-bit platforms and test
- # is_a?(Bignum)
assert_kind_of Integer, b.world_population
- assert_equal 6000000000, b.world_population
+ assert_equal 2**62, b.world_population
assert_kind_of Integer, b.my_house_population
assert_equal 3, b.my_house_population
assert_kind_of BigDecimal, b.bank_balance
diff --git a/activerecord/test/cases/numeric_data_test.rb b/activerecord/test/cases/numeric_data_test.rb
index f917c8f727..14db63890e 100644
--- a/activerecord/test/cases/numeric_data_test.rb
+++ b/activerecord/test/cases/numeric_data_test.rb
@@ -19,7 +19,7 @@ class NumericDataTest < ActiveRecord::TestCase
m = NumericData.new(
bank_balance: 1586.43,
big_bank_balance: BigDecimal("1000234000567.95"),
- world_population: 6000000000,
+ world_population: 2**62,
my_house_population: 3
)
assert m.save
@@ -27,11 +27,8 @@ class NumericDataTest < ActiveRecord::TestCase
m1 = NumericData.find(m.id)
assert_not_nil m1
- # As with migration_test.rb, we should make world_population >= 2**62
- # to cover 64-bit platforms and test it is a Bignum, but the main thing
- # is that it's an Integer.
assert_kind_of Integer, m1.world_population
- assert_equal 6000000000, m1.world_population
+ assert_equal 2**62, m1.world_population
assert_kind_of Integer, m1.my_house_population
assert_equal 3, m1.my_house_population
@@ -47,7 +44,7 @@ class NumericDataTest < ActiveRecord::TestCase
m = NumericData.new(
bank_balance: 1586.43122334,
big_bank_balance: BigDecimal("234000567.952344"),
- world_population: 6000000000,
+ world_population: 2**62,
my_house_population: 3
)
assert m.save
@@ -55,11 +52,8 @@ class NumericDataTest < ActiveRecord::TestCase
m1 = NumericData.find(m.id)
assert_not_nil m1
- # As with migration_test.rb, we should make world_population >= 2**62
- # to cover 64-bit platforms and test it is a Bignum, but the main thing
- # is that it's an Integer.
assert_kind_of Integer, m1.world_population
- assert_equal 6000000000, m1.world_population
+ assert_equal 2**62, m1.world_population
assert_kind_of Integer, m1.my_house_population
assert_equal 3, m1.my_house_population
diff --git a/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb b/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb
index b892f50e41..7d4233fe31 100644
--- a/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb
+++ b/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb
@@ -5,7 +5,7 @@ class GiveMeBigNumbers < ActiveRecord::Migration::Current
create_table :big_numbers do |table|
table.column :bank_balance, :decimal, precision: 10, scale: 2
table.column :big_bank_balance, :decimal, precision: 15, scale: 2
- table.column :world_population, :decimal, precision: 10
+ table.column :world_population, :decimal, precision: 20
table.column :my_house_population, :decimal, precision: 2
table.column :value_of_e, :decimal
end
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 3f4fe16678..8b0106dbf0 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -547,7 +547,7 @@ ActiveRecord::Schema.define do
create_table :numeric_data, force: true do |t|
t.decimal :bank_balance, precision: 10, scale: 2
t.decimal :big_bank_balance, precision: 15, scale: 2
- t.decimal :world_population, precision: 10, scale: 0
+ t.decimal :world_population, precision: 20, scale: 0
t.decimal :my_house_population, precision: 2, scale: 0
t.decimal :decimal_number_with_default, precision: 3, scale: 2, default: 2.78
t.float :temperature
diff --git a/railties/test/commands/routes_test.rb b/railties/test/commands/routes_test.rb
index b3d85882ab..409a6f3417 100644
--- a/railties/test/commands/routes_test.rb
+++ b/railties/test/commands/routes_test.rb
@@ -39,12 +39,11 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
output = run_routes_command(["-g", "show"])
assert_equal <<~MESSAGE, output
- Prefix Verb URI Pattern Controller#Action
- cart GET /cart(.:format) cart#show
- rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show
- rails_blob_variation GET /rails/active_storage/variants/:signed_blob_id/:variation_key/*filename(.:format) active_storage/variants#show
- rails_blob_preview GET /rails/active_storage/previews/:signed_blob_id/:variation_key/*filename(.:format) active_storage/previews#show
- rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
+ Prefix Verb URI Pattern Controller#Action
+ cart GET /cart(.:format) cart#show
+ rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show
+ rails_blob_representation GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show
+ rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
MESSAGE
output = run_routes_command(["-g", "POST"])
@@ -108,13 +107,12 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
RUBY
assert_equal <<~MESSAGE, run_routes_command
- Prefix Verb URI Pattern Controller#Action
- rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show
- rails_blob_variation GET /rails/active_storage/variants/:signed_blob_id/:variation_key/*filename(.:format) active_storage/variants#show
- rails_blob_preview GET /rails/active_storage/previews/:signed_blob_id/:variation_key/*filename(.:format) active_storage/previews#show
- rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
- update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
- rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
+ Prefix Verb URI Pattern Controller#Action
+ rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show
+ rails_blob_representation GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show
+ rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
+ update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
+ rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
MESSAGE
end
@@ -138,26 +136,21 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
URI | /rails/active_storage/blobs/:signed_id/*filename(.:format)
Controller#Action | active_storage/blobs#show
--[ Route 3 ]------------------------------------------------------------
- Prefix | rails_blob_variation
+ Prefix | rails_blob_representation
Verb | GET
- URI | /rails/active_storage/variants/:signed_blob_id/:variation_key/*filename(.:format)
- Controller#Action | active_storage/variants#show
+ URI | /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format)
+ Controller#Action | active_storage/representations#show
--[ Route 4 ]------------------------------------------------------------
- Prefix | rails_blob_preview
- Verb | GET
- URI | /rails/active_storage/previews/:signed_blob_id/:variation_key/*filename(.:format)
- Controller#Action | active_storage/previews#show
- --[ Route 5 ]------------------------------------------------------------
Prefix | rails_disk_service
Verb | GET
URI | /rails/active_storage/disk/:encoded_key/*filename(.:format)
Controller#Action | active_storage/disk#show
- --[ Route 6 ]------------------------------------------------------------
+ --[ Route 5 ]------------------------------------------------------------
Prefix | update_rails_disk_service
Verb | PUT
URI | /rails/active_storage/disk/:encoded_token(.:format)
Controller#Action | active_storage/disk#update
- --[ Route 7 ]------------------------------------------------------------
+ --[ Route 6 ]------------------------------------------------------------
Prefix | rails_direct_uploads
Verb | POST
URI | /rails/active_storage/direct_uploads(.:format)