mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Supplement registrar specs
This commit is contained in:
parent
91bc1ab23d
commit
e72c00850b
2 changed files with 28 additions and 0 deletions
|
@ -17,6 +17,16 @@ RSpec.describe 'admin registrar create' do
|
|||
expect(registrar.website).to eq('test')
|
||||
end
|
||||
|
||||
it 'saves email' do
|
||||
post admin_registrars_path, { registrar: attributes_for(:registrar, email: 'test@test.com') }
|
||||
expect(registrar.email).to eq('test@test.com')
|
||||
end
|
||||
|
||||
it 'saves billing email' do
|
||||
post admin_registrars_path, { registrar: attributes_for(:registrar, billing_email: 'test@test.com') }
|
||||
expect(registrar.billing_email).to eq('test@test.com')
|
||||
end
|
||||
|
||||
it 'redirects to :show' do
|
||||
post admin_registrars_path, { registrar: attributes_for(:registrar) }
|
||||
expect(response).to redirect_to admin_registrar_path(registrar)
|
||||
|
|
|
@ -14,6 +14,24 @@ RSpec.describe 'admin registrar update' do
|
|||
expect(registrar.website).to eq('new-website')
|
||||
end
|
||||
|
||||
it 'updates email' do
|
||||
registrar = create(:registrar, email: 'test@test.com')
|
||||
|
||||
patch admin_registrar_path(registrar), registrar: attributes_for(:registrar, email: 'new-test@test.com')
|
||||
registrar.reload
|
||||
|
||||
expect(registrar.email).to eq('new-test@test.com')
|
||||
end
|
||||
|
||||
it 'updates billing email' do
|
||||
registrar = create(:registrar, billing_email: 'test@test.com')
|
||||
|
||||
patch admin_registrar_path(registrar), registrar: attributes_for(:registrar, billing_email: 'new-test@test.com')
|
||||
registrar.reload
|
||||
|
||||
expect(registrar.billing_email).to eq('new-test@test.com')
|
||||
end
|
||||
|
||||
it 'redirects to :show' do
|
||||
registrar = create(:registrar)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue