aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/relations/rename_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/active_relation/relations/rename_spec.rb')
-rw-r--r--spec/active_relation/relations/rename_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/active_relation/relations/rename_spec.rb b/spec/active_relation/relations/rename_spec.rb
index ebe95f13b9..695e51c191 100644
--- a/spec/active_relation/relations/rename_spec.rb
+++ b/spec/active_relation/relations/rename_spec.rb
@@ -3,15 +3,15 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
module ActiveRelation
describe Rename do
before do
- @relation1 = Table.new(:foo)
- @relation2 = Table.new(:bar)
+ @relation1 = Table.new(:users)
+ @relation2 = Table.new(:photos)
@renamed_relation = Rename.new(@relation1, @relation1[:id] => :schmid)
end
describe '#initialize' do
it "manufactures nested rename relations if multiple renames are provided" do
Rename.new(@relation1, @relation1[:id] => :humpty, @relation1[:name] => :dumpty). \
- should == Rename.new(Rename.new(@relation1, @relation1[:id] => :humpty), @relation1[:name] => :dumpty)
+ should == Rename.new(Rename.new(@relation1, @relation1[:name] => :dumpty), @relation1[:id] => :humpty)
end
end
@@ -50,6 +50,7 @@ module ActiveRelation
describe 'when given an', Expression do
it "manufactures a substituted and renamed expression if the expression is within the relation" do
+ pending
end
end
@@ -97,8 +98,8 @@ module ActiveRelation
describe '#to_sql' do
it 'manufactures sql renaming the attribute' do
@renamed_relation.to_sql.should be_like("""
- SELECT `foo`.`name`, `foo`.`id` AS 'schmid'
- FROM `foo`
+ SELECT `users`.`id` AS 'schmid', `users`.`name`
+ FROM `users`
""")
end
end