aboutsummaryrefslogtreecommitdiffstats
path: root/spec/attributes/header_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/attributes/header_spec.rb')
-rw-r--r--spec/attributes/header_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/attributes/header_spec.rb b/spec/attributes/header_spec.rb
index 5811041734..8fb4007003 100644
--- a/spec/attributes/header_spec.rb
+++ b/spec/attributes/header_spec.rb
@@ -18,8 +18,15 @@ module Arel
end
end
- it "finds attributes by name" do
- @relation.attributes[:name].should == Attributes::String.new(@relation, :name)
+ describe "attribute lookup" do
+ it "finds attributes by name" do
+ @relation.attributes[:name].should == Attributes::String.new(@relation, :name)
+ end
+
+ it "returns nil if no attribute is found" do
+ @relation.attributes[:does_not_exist].should be_nil
+ @relation[:does_not_exist].should be_nil
+ end
end
describe "#union" do