aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-09-27 07:24:06 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-09-27 07:24:06 +0900
commitc13dc0f8252ceb89d471482808c4419eaa5235ae (patch)
tree0ce6d9fd3b147c29df18d641e07d28f5391fd98b /activerecord
parent56b3849316b9c4cf4423ef8de30cbdc1b7e0f7af (diff)
downloadrails-c13dc0f8252ceb89d471482808c4419eaa5235ae.tar.gz
rails-c13dc0f8252ceb89d471482808c4419eaa5235ae.tar.bz2
rails-c13dc0f8252ceb89d471482808c4419eaa5235ae.zip
Extract `NumericData` model for tests
Currently `NumericData` model is defined some places.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/base_test.rb8
-rw-r--r--activerecord/test/cases/calculations_test.rb9
-rw-r--r--activerecord/test/cases/dirty_test.rb5
-rw-r--r--activerecord/test/models/numeric_data.rb3
4 files changed, 6 insertions, 19 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index fafa144c6f..4ab8118028 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -15,6 +15,7 @@ require "models/boolean"
require "models/column_name"
require "models/subscriber"
require "models/comment"
+require "models/numeric_data"
require "models/minimalistic"
require "models/warehouse_thing"
require "models/parrot"
@@ -908,13 +909,6 @@ class BasicsTest < ActiveRecord::TestCase
end
end
- class NumericData < ActiveRecord::Base
- self.table_name = "numeric_data"
-
- attribute :my_house_population, :integer
- attribute :atoms_in_universe, :integer
- end
-
def test_big_decimal_conditions
m = NumericData.new(
bank_balance: 1586.43,
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index db2871d383..7e7076196f 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -8,6 +8,7 @@ require "models/organization"
require "models/possession"
require "models/topic"
require "models/reply"
+require "models/numeric_data"
require "models/minivan"
require "models/speedometer"
require "models/ship_part"
@@ -17,14 +18,6 @@ require "models/comment"
require "models/rating"
require "models/post"
-class NumericData < ActiveRecord::Base
- self.table_name = "numeric_data"
-
- attribute :world_population, :integer
- attribute :my_house_population, :integer
- attribute :atoms_in_universe, :integer
-end
-
class CalculationsTest < ActiveRecord::TestCase
fixtures :companies, :accounts, :topics, :speedometers, :minivans, :books
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index 09bd00291d..eee34da664 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -4,10 +4,7 @@ require "models/pirate" # For timestamps
require "models/parrot"
require "models/person" # For optimistic locking
require "models/aircraft"
-
-class NumericData < ActiveRecord::Base
- self.table_name = "numeric_data"
-end
+require "models/numeric_data"
class DirtyTest < ActiveRecord::TestCase
include InTimeZone
diff --git a/activerecord/test/models/numeric_data.rb b/activerecord/test/models/numeric_data.rb
new file mode 100644
index 0000000000..9d2fe9781d
--- /dev/null
+++ b/activerecord/test/models/numeric_data.rb
@@ -0,0 +1,3 @@
+class NumericData < ActiveRecord::Base
+ self.table_name = "numeric_data"
+end