spec/unit/data_store_spec.rb in friendly-0.4.3 vs spec/unit/data_store_spec.rb in friendly-0.4.4
- old
+ new
@@ -74,9 +74,22 @@
it "orders the filtered dataset and returns the results" do
@return.should == [{:id => 1}]
end
end
+ describe "all without conditions" do
+ before do
+ @all = stub(:map => [])
+ @users.stubs(:order).with(:created_at).returns(@all)
+ @query = query(:order! => :created_at)
+ @return = @datastore.all(@klass, @query)
+ end
+
+ it "orders the filtered dataset and returns the results" do
+ @return.should == []
+ end
+ end
+
describe "retrieving first with conditions" do
before do
@users.first = {{:id => 1} => {:id => 1}}
@return = @datastore.first(@klass, query(:id => 1))
end