aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-07-31 16:21:07 -0300
committerEmilio Tagua <miloops@gmail.com>2009-07-31 16:21:07 -0300
commit3de59e916d6a3d4eab202cf0c99b1f88905a3b43 (patch)
treedef6d6a808ebe187be1f37f8a739fd786cc11f02 /activerecord/test
parentc1cbf02e3170f1004daf4a146cbc41176c2458d3 (diff)
parent62fd1d3716b4b5fd1d91cdcc77003efe80fc5a7e (diff)
downloadrails-3de59e916d6a3d4eab202cf0c99b1f88905a3b43.tar.gz
rails-3de59e916d6a3d4eab202cf0c99b1f88905a3b43.tar.bz2
rails-3de59e916d6a3d4eab202cf0c99b1f88905a3b43.zip
Merge commit 'rails/master'
Conflicts: activerecord/lib/active_record/associations.rb
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb4
-rwxr-xr-xactiverecord/test/cases/base_test.rb5
-rw-r--r--activerecord/test/cases/named_scope_test.rb4
-rw-r--r--activerecord/test/cases/xml_serialization_test.rb6
-rw-r--r--activerecord/test/models/topic.rb2
5 files changed, 6 insertions, 15 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 183be1e2f9..168b617fbc 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -74,10 +74,6 @@ class AttributeMethodsTest < ActiveRecord::TestCase
end
end
- def test_primary_key_implemented
- assert Class.new(ActiveRecord::Base).instance_method_already_implemented?('id')
- end
-
def test_defined_kernel_methods_implemented_in_model
%w(test name display y).each do |method|
klass = Class.new ActiveRecord::Base
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index 3143ec2850..6bfe05b4fd 100755
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -422,11 +422,6 @@ class BasicsTest < ActiveRecord::TestCase
end
- def test_reader_for_invalid_column_names
- Topic.send(:define_read_method, "mumub-jumbo".to_sym, "mumub-jumbo", nil)
- assert !Topic.generated_methods.include?("mumub-jumbo")
- end
-
def test_non_attribute_access_and_assignment
topic = Topic.new
assert !topic.respond_to?("mumbo")
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb
index 10daff5d65..3cb6b01e80 100644
--- a/activerecord/test/cases/named_scope_test.rb
+++ b/activerecord/test/cases/named_scope_test.rb
@@ -354,10 +354,6 @@ class NamedScopeTest < ActiveRecord::TestCase
assert_equal [posts(:sti_comments)], Post.with_special_comments.with_post(4).all.to_a.uniq
end
- def test_methods_invoked_within_scopes_should_respect_scope
- assert_equal [], Topic.approved.by_rejected_ids.proxy_options[:conditions][:id]
- end
-
def test_named_scopes_batch_finders
assert_equal 3, Topic.approved.count
diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb
index b49997669e..e1ad5c1685 100644
--- a/activerecord/test/cases/xml_serialization_test.rb
+++ b/activerecord/test/cases/xml_serialization_test.rb
@@ -174,6 +174,12 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
assert_match %r{<nationality>Danish</nationality>}, xml
end
+ def test_dual_arity_procs_are_called_on_object
+ proc = Proc.new { |options, record| options[:builder].tag!('name-reverse', record.name.reverse) }
+ xml = authors(:david).to_xml(:procs => [ proc ])
+ assert_match %r{<name-reverse>divaD</name-reverse>}, xml
+ end
+
def test_top_level_procs_arent_applied_to_associations
author_proc = Proc.new { |options| options[:builder].tag!('nationality', 'Danish') }
xml = authors(:david).to_xml(:procs => [ author_proc ], :include => :posts, :indent => 2)
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 201d96dcd7..9594dc300a 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -35,8 +35,6 @@ class Topic < ActiveRecord::Base
end
named_scope :named_extension, :extend => NamedExtension
named_scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
-
- named_scope :by_rejected_ids, lambda {{ :conditions => { :id => all(:conditions => {:approved => false}).map(&:id) } }}
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"