diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 18:48:06 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 18:48:06 -0300 |
commit | 59a0700b56cb6dc895d5f371b08ba7a339bc2d98 (patch) | |
tree | 1b8e054727f58b3f05b5d8df56a933bcc9518715 /activerecord/test | |
parent | ad4272922d6a42ac1fed2282bcc7bd937c85bb30 (diff) | |
download | rails-59a0700b56cb6dc895d5f371b08ba7a339bc2d98.tar.gz rails-59a0700b56cb6dc895d5f371b08ba7a339bc2d98.tar.bz2 rails-59a0700b56cb6dc895d5f371b08ba7a339bc2d98.zip |
Both tests are using the same model, move the model to another file and add the missing require
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/cases/base_test.rb | 27 | ||||
-rw-r--r-- | activerecord/test/schema/schema.rb | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index d9e5efa8da..a698f23fb6 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -2,6 +2,7 @@ require "cases/helper" require 'models/minimalistic' require 'models/developer' require 'models/auto_id' +require 'models/boolean' require 'models/computer' require 'models/topic' require 'models/company' @@ -101,7 +102,7 @@ class AttributeMethodsTest < ActiveRecord::TestCase if current_adapter?(:MysqlAdapter) def test_read_attributes_before_type_cast_on_boolean - bool = Booleantest.create({ "value" => false }) + bool = Boolean.create({ "value" => false }) assert_equal "0", bool.reload.attributes_before_type_cast["value"] end end diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index ca397d3847..b2799f649a 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -10,6 +10,7 @@ require 'models/developer' require 'models/project' require 'models/default' require 'models/auto_id' +require 'models/boolean' require 'models/column_name' require 'models/subscriber' require 'models/keyboard' @@ -42,7 +43,7 @@ class ReadonlyTitlePost < Post attr_readonly :title end -class Booleantest < ActiveRecord::Base; end +class Boolean < ActiveRecord::Base; end class BasicsTest < ActiveRecord::TestCase fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories, :posts @@ -596,34 +597,34 @@ class BasicsTest < ActiveRecord::TestCase end def test_boolean - b_nil = Booleantest.create({ "value" => nil }) + b_nil = Boolean.create({ "value" => nil }) nil_id = b_nil.id - b_false = Booleantest.create({ "value" => false }) + b_false = Boolean.create({ "value" => false }) false_id = b_false.id - b_true = Booleantest.create({ "value" => true }) + b_true = Boolean.create({ "value" => true }) true_id = b_true.id - b_nil = Booleantest.find(nil_id) + b_nil = Boolean.find(nil_id) assert_nil b_nil.value - b_false = Booleantest.find(false_id) + b_false = Boolean.find(false_id) assert !b_false.value? - b_true = Booleantest.find(true_id) + b_true = Boolean.find(true_id) assert b_true.value? end def test_boolean_cast_from_string - b_blank = Booleantest.create({ "value" => "" }) + b_blank = Boolean.create({ "value" => "" }) blank_id = b_blank.id - b_false = Booleantest.create({ "value" => "0" }) + b_false = Boolean.create({ "value" => "0" }) false_id = b_false.id - b_true = Booleantest.create({ "value" => "1" }) + b_true = Boolean.create({ "value" => "1" }) true_id = b_true.id - b_blank = Booleantest.find(blank_id) + b_blank = Boolean.find(blank_id) assert_nil b_blank.value - b_false = Booleantest.find(false_id) + b_false = Boolean.find(false_id) assert !b_false.value? - b_true = Booleantest.find(true_id) + b_true = Boolean.find(true_id) assert b_true.value? end diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index ce7ee78aea..8017e13920 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -74,7 +74,7 @@ ActiveRecord::Schema.define do t.column :name, :string end - create_table :booleantests, :force => true do |t| + create_table :booleans, :force => true do |t| t.boolean :value end |