diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-02-04 22:00:11 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-02-04 22:00:11 -0800 |
commit | 61d6c2c1c5215014971355892e024682ed148ebb (patch) | |
tree | ac0f47e8daa7ae0e787b8291bb367737259c4e15 /spec | |
parent | 7523c8690deda1b24def03eb049f61baf2f1b466 (diff) | |
download | rails-61d6c2c1c5215014971355892e024682ed148ebb.tar.gz rails-61d6c2c1c5215014971355892e024682ed148ebb.tar.bz2 rails-61d6c2c1c5215014971355892e024682ed148ebb.zip |
nk - missing file?
Diffstat (limited to 'spec')
-rw-r--r-- | spec/active_relation/relations/alias_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/active_relation/relations/alias_spec.rb b/spec/active_relation/relations/alias_spec.rb index c02b0df453..ddb0c59d08 100644 --- a/spec/active_relation/relations/alias_spec.rb +++ b/spec/active_relation/relations/alias_spec.rb @@ -4,7 +4,19 @@ module ActiveRelation describe Alias do before do @relation = Table.new(:users) - @alias_relation = @relation.as(:foo) + @alias_relation = Alias.new(@relation, :foo) + end + + describe '#prefix_for' do + it "delegates to the underlying relation" do + @alias_relation.prefix_for(@relation[:id]).should == :users + end + end + + describe '#aliased_prefix_for' do + it "returns the alias" do + @alias_relation.aliased_prefix_for(@relation[:id]).should == :foo + end end end end
\ No newline at end of file |