aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/relations/order_spec.rb
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2008-01-14 10:50:46 -0500
committerBryan Helmkamp <bryan@brynary.com>2008-01-14 10:50:46 -0500
commit553eb0ad490abc7f85d9836c3ba959ab771d3cf4 (patch)
treebaa9714465488d77980e8d252a82849b32844d3b /spec/active_relation/relations/order_spec.rb
parent17a5fd13bc4ba8405d95e90d12b87dcd7e5bea5b (diff)
downloadrails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.tar.gz
rails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.tar.bz2
rails-553eb0ad490abc7f85d9836c3ba959ab771d3cf4.zip
Remove ActiveRelation sub-modules and refactor specs
Diffstat (limited to 'spec/active_relation/relations/order_spec.rb')
-rw-r--r--spec/active_relation/relations/order_spec.rb44
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