Skip to content
Browse files

Merge remote branch 'rails/master'

  • Loading branch information...
2 parents 0d5a060 + 3ba61ec commit 6f929ef801f625854b89eae5b440c04f5d0eef70 @fxn fxn committed Aug 15, 2010
View
2 actionpack/test/controller/resources_test.rb
@@ -1,5 +1,5 @@
-require 'active_support/core_ext/object/try'
require 'abstract_unit'
+require 'active_support/core_ext/object/try'
class ResourcesController < ActionController::Base
def index() render :nothing => true end
View
3 activerecord/test/cases/attribute_methods_test.rb
@@ -2,6 +2,7 @@
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 @@ def test_read_attributes_before_type_cast
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
View
27 activerecord/test/cases/base_test.rb
@@ -10,6 +10,7 @@
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 @@ def test_attributes_on_dummy_time
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
View
2 activerecord/test/models/boolean.rb
@@ -0,0 +1,2 @@
+class Boolean < ActiveRecord::Base
+end
View
2 activerecord/test/schema/schema.rb
@@ -74,7 +74,7 @@ def create_table(*args, &block)
t.column :name, :string
end
- create_table :booleantests, :force => true do |t|
+ create_table :booleans, :force => true do |t|
t.boolean :value
end

0 comments on commit 6f929ef

Please sign in to comment.
Something went wrong with that request. Please try again.