mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Added Registrar feature tests
This commit is contained in:
parent
bcb283e2f1
commit
45bed63cad
12 changed files with 218 additions and 25 deletions
44
spec/features/registrar/domain_spec.rb
Normal file
44
spec/features/registrar/domain_spec.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
require 'rails_helper'
|
||||
|
||||
feature 'Domains', type: :feature do
|
||||
before :all do
|
||||
create_settings
|
||||
@user = Fabricate(:api_user)
|
||||
end
|
||||
|
||||
context 'as unknown user' do
|
||||
it 'should redirect to sign in page' do
|
||||
visit '/registrar/domains'
|
||||
current_path.should == '/registrar/login'
|
||||
page.should have_text('You need to sign in or sign up')
|
||||
end
|
||||
end
|
||||
|
||||
context 'as signed in user' do
|
||||
before do
|
||||
registrar_sign_in
|
||||
end
|
||||
|
||||
it 'should navigate to the domains index page' do
|
||||
click_link 'Domains'
|
||||
current_path.should == '/registrar/domains'
|
||||
end
|
||||
|
||||
it 'should get domains index page' do
|
||||
visit '/registrar/domains'
|
||||
current_path.should == '/registrar/domains'
|
||||
end
|
||||
|
||||
it 'should navigate to new page' do
|
||||
click_link 'Domains'
|
||||
click_link 'New'
|
||||
|
||||
current_path.should == '/registrar/domains/new'
|
||||
end
|
||||
|
||||
it 'should get new page' do
|
||||
visit '/registrar/domains/new'
|
||||
current_path.should == '/registrar/domains/new'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue