Skip to content

Instantly share code, notes, and snippets.

@roushkaman
Created December 27, 2012 11:40
Show Gist options
  • Save roushkaman/4387598 to your computer and use it in GitHub Desktop.
Save roushkaman/4387598 to your computer and use it in GitHub Desktop.
context :search do
before { get :index, :search => { :full_search => product.name } }
context :with_one_product do
it do
get :show, :id => product.id
response.should be_success
end
end
context :with_many_products do
it do
controller.stub(:collection).and_return([create(:product), create(:product), create(:product)])
get :index, :search => { :full_search => product.name }
response.should be_success
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment