Slide 66
Slide 66 text
Testing with verified doubles
describe Workflows::OnboardProduction do
let(:production_id) { SecureRandom.uuid }
let(:vertical_id) { SecureRandom.uuid }
let(:response) do
described_class.call(production_id: production_id, vertical_id: vertical_id, repo: repo)
end
describe 'when a production already exists' do
let(:repo) { instance_double(Workflow::ProductionRepo, find_by_id: existing_production) }
it 'the response is a failure' do
expect(response).to be_a_failure
end
end
...
end