Created
December 7, 2018 07:40
-
-
Save Levii01/25e0f61d9f00f164df4f01b078e977a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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