Permalink
Browse files

Added specs for AbstractModel#where for Mongoid and ActiveRecord

  • Loading branch information...
1 parent 4c6814a commit 1c1a60b5fb3bbd1ecdfcd5b2c946c943fcded9b8 @timkurvers timkurvers committed Apr 15, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 spec/unit/adapters/active_record_spec.rb
  2. +4 −0 spec/unit/adapters/mongoid_spec.rb
View
4 spec/unit/adapters/active_record_spec.rb
@@ -192,6 +192,10 @@ class ARComment < ActiveRecord::Base
Player.all.should == @players[2..2]
end
+ it "#where returns filtered results" do
+ @abstract_model.where(:name => @players.first.name).should == [@players.first]
+ end
+
describe "#all" do
it "works without options" do
@abstract_model.all.should =~ @players
View
4 spec/unit/adapters/mongoid_spec.rb
@@ -413,6 +413,10 @@ class MongoEmbedded
Player.all.should == @players[2..2]
end
+ it "#where returns filtered results" do
+ @abstract_model.where(:name => @players.first.name).to_a.should == [@players.first]
+ end
+
describe "#all" do
it "works without options" do
@abstract_model.all.to_a.should =~ @players

0 comments on commit 1c1a60b

Please sign in to comment.