mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
parent
6f907e11b5
commit
b4b715f405
7 changed files with 61 additions and 11 deletions
20
spec/features/admin/registrars/create_spec.rb
Normal file
20
spec/features/admin/registrars/create_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'New registrar' do
|
||||
background do
|
||||
sign_in_to_admin_area
|
||||
end
|
||||
|
||||
it 'creates registrar' do
|
||||
visit admin_registrars_url
|
||||
click_link_or_button 'New registrar'
|
||||
|
||||
fill_in 'registrar[name]', with: 'test'
|
||||
fill_in 'registrar[reg_no]', with: '1234567'
|
||||
fill_in 'registrar[email]', with: 'test@test.com'
|
||||
fill_in 'registrar[code]', with: 'test'
|
||||
click_link_or_button 'Create registrar'
|
||||
|
||||
expect(page).to have_text('Registrar has been successfully created')
|
||||
end
|
||||
end
|
18
spec/features/admin/registrars/edit_spec.rb
Normal file
18
spec/features/admin/registrars/edit_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Edit registrar' do
|
||||
given!(:registrar) { create(:registrar_with_unlimited_balance) }
|
||||
|
||||
background do
|
||||
sign_in_to_admin_area
|
||||
end
|
||||
|
||||
it 'updates registrar' do
|
||||
visit admin_registrar_url(registrar)
|
||||
click_link_or_button 'Edit'
|
||||
|
||||
click_link_or_button 'Update registrar'
|
||||
|
||||
expect(page).to have_text('Registrar has been successfully updated')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue