diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-12 23:36:28 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-12 23:36:28 -0800 |
commit | eecab85b331c6bb716978262b418ab02ff4a22e9 (patch) | |
tree | f0f5be2e5961a2b884bd4258be8010d3d6dfd6be /spec/active_relation | |
parent | 7c7044085617a66abb3f9bd37dc7c072701f03c7 (diff) | |
download | rails-eecab85b331c6bb716978262b418ab02ff4a22e9.tar.gz rails-eecab85b331c6bb716978262b418ab02ff4a22e9.tar.bz2 rails-eecab85b331c6bb716978262b418ab02ff4a22e9.zip |
experimenting with new aliasing terminology and interface
Diffstat (limited to 'spec/active_relation')
-rw-r--r-- | spec/active_relation/relations/rename_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/active_relation/relations/rename_spec.rb b/spec/active_relation/relations/rename_spec.rb index 76b7069190..bdc5c97492 100644 --- a/spec/active_relation/relations/rename_spec.rb +++ b/spec/active_relation/relations/rename_spec.rb @@ -12,26 +12,26 @@ describe ActiveRelation::Relations::Rename do should == ActiveRelation::Relations::Rename.new(ActiveRelation::Relations::Rename.new(@relation, @relation[:id] => :humpty), @relation[:name] => :dumpty) end - it "raises an exception if the alias provided is already used" do + it "raises an exception if the rename provided is already used" do pending end end describe '==' do - it "obtains if the relation, attribute, and alias are identical" do + it "obtains if the relation, attribute, and rename are identical" do pending end end describe '#attributes' do - it "manufactures a list of attributes with the renamed attribute aliased" do + it "manufactures a list of attributes with the renamed attribute renameed" do ActiveRelation::Relations::Rename.new(@relation, @relation[:id] => :schmid).attributes.should == (@relation.attributes - [@relation[:id]]) + [@relation[:id].as(:schmid)] end end describe '[]' do - it 'indexes attributes by alias' do + it 'indexes attributes by rename' do @renamed_relation[:id].should be_nil @renamed_relation[:schmid].should == @relation[:id].as(:schmid) end @@ -51,7 +51,7 @@ describe ActiveRelation::Relations::Rename do end describe '#to_sql' do - it 'manufactures sql aliasing the attribute' do + it 'manufactures sql renameing the attribute' do @renamed_relation.to_sql.should be_like(""" SELECT `foo`.`name`, `foo`.`id` AS 'schmid' FROM `foo` |