Skip to content

Instantly share code, notes, and snippets.

@tpendragon
Created January 1, 2015 07:12
Show Gist options
  • Save tpendragon/1555671611cbc96e5e65 to your computer and use it in GitHub Desktop.
Save tpendragon/1555671611cbc96e5e65 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe StartersController do
describe "#index" do
fake(:starter_pet_finder, :all => [])
before do
stub(Tressonia::Pets::StarterPetFinder).new { starter_pet_finder }
get :index
end
it "finds the pets" do
expect(starter_pet_finder).to have_received.all
expect(assigns(:pets)).to eq starter_pet_finder.all
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment