Skip to content

Commit

Permalink
we don't need to test that constant assignment works
Browse files Browse the repository at this point in the history
  • Loading branch information
jonleighton committed Apr 13, 2012
1 parent 88d1faf commit a258c27
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions activerecord/test/cases/relation_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,35 +19,20 @@ def test_construction
assert !relation.loaded, 'relation is not loaded' assert !relation.loaded, 'relation is not loaded'
end end


def test_single_values
assert_equal [:limit, :offset, :lock, :readonly, :from, :reordering, :reverse_order, :uniq].map(&:to_s).sort,
Relation::SINGLE_VALUE_METHODS.map(&:to_s).sort
end

def test_initialize_single_values def test_initialize_single_values
relation = Relation.new :a, :b relation = Relation.new :a, :b
Relation::SINGLE_VALUE_METHODS.each do |method| Relation::SINGLE_VALUE_METHODS.each do |method|
assert_nil relation.send("#{method}_value"), method.to_s assert_nil relation.send("#{method}_value"), method.to_s
end end
end end


def test_association_methods
assert_equal [:includes, :eager_load, :preload].map(&:to_s).sort,
Relation::ASSOCIATION_METHODS.map(&:to_s).sort
end

def test_initialize_association_methods def test_initialize_association_methods
relation = Relation.new :a, :b relation = Relation.new :a, :b
Relation::ASSOCIATION_METHODS.each do |method| Relation::ASSOCIATION_METHODS.each do |method|
assert_equal [], relation.send("#{method}_values"), method.to_s assert_equal [], relation.send("#{method}_values"), method.to_s
end end
end end


def test_multi_value_methods
assert_equal [:select, :group, :order, :joins, :where, :having, :bind, :references].map(&:to_s).sort,
Relation::MULTI_VALUE_METHODS.map(&:to_s).sort
end

def test_multi_value_initialize def test_multi_value_initialize
relation = Relation.new :a, :b relation = Relation.new :a, :b
Relation::MULTI_VALUE_METHODS.each do |method| Relation::MULTI_VALUE_METHODS.each do |method|
Expand Down

0 comments on commit a258c27

Please sign in to comment.