1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/relations/join_relation_spec.rb

20 lines
796 B
Ruby
Raw Normal View History

2007-12-30 14:35:44 -05:00
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
describe JoinRelation, 'between two relations' do
before do
@relation1 = TableRelation.new(:foo)
@relation2 = TableRelation.new(:bar)
@predicate = Predicate.new
end
describe JoinRelation, '==' do
it "obtains if the two relations and the predicate are identical" do
JoinRelation.new(@relation1, @relation2, @predicate).should == JoinRelation.new(@relation1, @relation2, @predicate)
JoinRelation.new(@relation1, @relation2, @predicate).should_not == JoinRelation.new(@relation1, @relation1, @predicate)
end
it "is commutative on the relations" do
JoinRelation.new(@relation1, @relation2, @predicate).should == JoinRelation.new(@relation2, @relation1, @predicate)
end
end
end