diff options
Diffstat (limited to 'spec/active_relation/relations/order_spec.rb')
-rw-r--r-- | spec/active_relation/relations/order_spec.rb | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/spec/active_relation/relations/order_spec.rb b/spec/active_relation/relations/order_spec.rb index edf2faf455..204558daec 100644 --- a/spec/active_relation/relations/order_spec.rb +++ b/spec/active_relation/relations/order_spec.rb @@ -1,28 +1,30 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') -describe ActiveRelation::Relations::Order do - before do - @relation1 = ActiveRelation::Relations::Table.new(:foo) - @relation2 = ActiveRelation::Relations::Table.new(:bar) - @attribute1 = @relation1[:id] - @attribute2 = @relation2[:id] - end +module ActiveRelation + describe Order do + before do + @relation1 = Table.new(:foo) + @relation2 = Table.new(:bar) + @attribute1 = @relation1[:id] + @attribute2 = @relation2[:id] + end - describe '#qualify' do - it "distributes over the relation and attributes" do - ActiveRelation::Relations::Order.new(@relation1, @attribute1).qualify. \ - should == ActiveRelation::Relations::Order.new(@relation1.qualify, @attribute1.qualify) + describe '#qualify' do + it "distributes over the relation and attributes" do + Order.new(@relation1, @attribute1).qualify. \ + should == Order.new(@relation1.qualify, @attribute1.qualify) + end end - end - describe '#to_sql' do - it "manufactures sql with an order clause" do - ActiveRelation::Relations::Order.new(@relation1, @attribute1).to_sql.should be_like(""" - SELECT `foo`.`name`, `foo`.`id` - FROM `foo` - ORDER BY `foo`.`id` - """) + describe '#to_sql' do + it "manufactures sql with an order clause" do + Order.new(@relation1, @attribute1).to_sql.should be_like(""" + SELECT `foo`.`name`, `foo`.`id` + FROM `foo` + ORDER BY `foo`.`id` + """) + end end end - -end
\ No newline at end of file +end +
\ No newline at end of file |