mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
18 lines
No EOL
760 B
Ruby
18 lines
No EOL
760 B
Ruby
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
|
|
|
describe ProjectionRelation do
|
|
before do
|
|
@relation1 = TableRelation.new(:foo)
|
|
@relation2 = TableRelation.new(:bar)
|
|
@attribute1 = @relation1[:foo]
|
|
@attribute2 = @relation2[:bar]
|
|
end
|
|
|
|
describe ProjectionRelation, '==' do
|
|
it "obtains if the relations and attributes are identical" do
|
|
ProjectionRelation.new(@relation1, @attribute1, @attribute2).should == ProjectionRelation.new(@relation1, @attribute1, @attribute2)
|
|
ProjectionRelation.new(@relation1, @attribute1).should_not == ProjectionRelation.new(@relation2, @attribute1)
|
|
ProjectionRelation.new(@relation1, @attribute1).should_not == ProjectionRelation.new(@relation1, @attribute2)
|
|
end
|
|
end
|
|
end |