Skip to content

Instantly share code, notes, and snippets.

@zapnap
Created February 16, 2009 15:10
Show Gist options
  • Save zapnap/65200 to your computer and use it in GitHub Desktop.
Save zapnap/65200 to your computer and use it in GitHub Desktop.
specify 'should retrieve artists for typeahead filtering' do
Artist.should_receive(:all).with(:limit => SiteConfig.max_artists, :name.like => '%ab%').and_return(@artists)
get '/artists.json', :q => 'ab'
end
Spec::Mocks::MockExpectationError in 'main application /artists.json should retrieve artists for typeahead filtering'
<Artist (class)> expected :all with ({#<DataMapper::Query::Operator:0x2526b2c @operator=:like, @target=:name>=>"%ab%", :limit=>500}) but received it with ({#<DataMapper::Query::Operator:0x2525380 @operator=:like, @target=:name>=>"%ab%", :limit=>500})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment