From 61d6c2c1c5215014971355892e024682ed148ebb Mon Sep 17 00:00:00 2001 From: Nick Kallen <nkallen@nick-kallens-computer-2.local> Date: Mon, 4 Feb 2008 22:00:11 -0800 Subject: nk - missing file? --- spec/active_relation/relations/alias_spec.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'spec/active_relation') 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 -- cgit v1.2.3