Skip to content

Instantly share code, notes, and snippets.

@Levii01
Created December 7, 2018 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Levii01/25e0f61d9f00f164df4f01b078e977a8 to your computer and use it in GitHub Desktop.
Save Levii01/25e0f61d9f00f164df4f01b078e977a8 to your computer and use it in GitHub Desktop.
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