Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
context 'when ssn is required' do
context 'empty ssn' do
let(:ssn) { '' }
it { expect(response).to have_http_status(422) }
it 'returns status 422' do
expect(response).to have_http_status(422)
end
it 'does not update ssn' do
expect(stackin_plus_account.reload.ssn).to eq(nil)
end
end
context 'invalid ssn' do
let(:ssn) { '999-99-9999' }
it 'returns status 422' do
expect(response).to have_http_status(422)
end
it 'does not update ssn' do
expect(stackin_plus_account.reload.ssn).to eq(nil)
end
end
context 'valid ssn' do
it 'returns status 204' do
expect(response).to have_http_status(204)
end
it 'updates ssn' do
expect(stackin_plus_account.reload.ssn).to eq(params[:ssn])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment