aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-17 11:59:03 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-17 11:59:03 -0700
commit3f55d33e530da1b5c454e0cfe920462d497649c8 (patch)
tree261b7a842ce9b2733bc7803b5d67a14356db6216 /spec
parent732b222126bd6b37925a4fcdcda832de65858122 (diff)
downloadrails-3f55d33e530da1b5c454e0cfe920462d497649c8.tar.gz
rails-3f55d33e530da1b5c454e0cfe920462d497649c8.tar.bz2
rails-3f55d33e530da1b5c454e0cfe920462d497649c8.zip
simplificatin of attribute division
Diffstat (limited to 'spec')
-rw-r--r--spec/arel/integration/joins/with_aggregations_spec.rb4
-rw-r--r--spec/arel/unit/primitives/attribute_spec.rb9
2 files changed, 5 insertions, 8 deletions
diff --git a/spec/arel/integration/joins/with_aggregations_spec.rb b/spec/arel/integration/joins/with_aggregations_spec.rb
index e6af920d32..b9cb4acc31 100644
--- a/spec/arel/integration/joins/with_aggregations_spec.rb
+++ b/spec/arel/integration/joins/with_aggregations_spec.rb
@@ -16,6 +16,10 @@ module Arel
end
describe '#attributes' do
+ it '' do
+ @relation1.join(@aggregation).on(@predicate)[@relation2[:user_id]].should_not be_nil
+ end
+
it 'it transforms aggregate expressions into attributes' do
join_with_aggregation = Join.new("INNER JOIN", @relation1, @aggregation, @predicate)
join_with_aggregation.attributes.should ==
diff --git a/spec/arel/unit/primitives/attribute_spec.rb b/spec/arel/unit/primitives/attribute_spec.rb
index 7e0155f84d..34665b5adf 100644
--- a/spec/arel/unit/primitives/attribute_spec.rb
+++ b/spec/arel/unit/primitives/attribute_spec.rb
@@ -62,20 +62,13 @@ module Arel
@doubly_aliased_relation = @aliased_relation.alias
end
- describe 'when dividing two identical attributes' do
- it "returns 1.0" do
- (@relation[:id] / @relation[:id]).should == 1.0
- (@aliased_relation[:id] / @aliased_relation[:id]).should == 1.0
- end
- end
-
describe 'when dividing two unrelated attributes' do
it "returns 0.0" do
(@relation[:id] / @relation[:name]).should == 0.0
end
end
- describe 'when dividing two similar attributes' do
+ describe 'when dividing two matching attributes' do
it 'returns a the highest score for the most similar attributes' do
(@aliased_relation[:id] / @relation[:id]) \
.should == (@aliased_relation[:id] / @relation[:id])