Skip to content

Commit

Permalink
Added failing test for delegating to named scopes with arity > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hlubek authored and binarylogic committed Jan 14, 2010
1 parent 1e3d192 commit 5eb5387
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/search_spec.rb
Expand Up @@ -365,5 +365,13 @@
search1.empty?.should == false
search2.empty?.should == true
end

it "should delegate to named scopes with arity > 1" do
User.named_scope :paged, lambda {|start, limit| { :limit => limit, :offset => start }}
User.create(:username => "bjohnson")
search = User.search(:username => "bjohnson")
search.paged(0, 1).count.should == 1
search.paged(0, 0).count.should == 0
end
end
end

0 comments on commit 5eb5387

Please sign in to comment.