aboutsummaryrefslogtreecommitdiffstats
path: root/spec/relations/order_relation_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/relations/order_relation_spec.rb')
-rw-r--r--spec/relations/order_relation_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/relations/order_relation_spec.rb b/spec/relations/order_relation_spec.rb
index 8050aa981c..d0654bd8da 100644
--- a/spec/relations/order_relation_spec.rb
+++ b/spec/relations/order_relation_spec.rb
@@ -4,8 +4,8 @@ describe OrderRelation do
before do
@relation1 = TableRelation.new(:foo)
@relation2 = TableRelation.new(:bar)
- @attribute1 = @relation1[:foo]
- @attribute2 = @relation2[:bar]
+ @attribute1 = @relation1[:id]
+ @attribute2 = @relation2[:id]
end
describe '==' do
@@ -18,13 +18,16 @@ describe OrderRelation do
describe '#to_sql' do
it "manufactures sql with an order clause" do
- OrderRelation.new(@relation1, @attribute1).to_sql.should == SelectBuilder.new do
- select { all }
+ OrderRelation.new(@relation1, @attribute1).to_sql.to_s.should == SelectBuilder.new do
+ select do
+ column :foo, :name
+ column :foo, :id
+ end
from :foo
order_by do
- column :foo, :foo
+ column :foo, :id
end
- end
+ end.to_s
end
end