Added Registrar feature tests

This commit is contained in:
Priit Tark 2015-04-13 16:54:00 +03:00
parent bcb283e2f1
commit 45bed63cad
12 changed files with 218 additions and 25 deletions

View file

@ -0,0 +1,35 @@
require 'rails_helper'
feature 'Invoices', 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/invoices'
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
current_path.should == '/registrar'
click_link 'Invoices'
current_path.should == '/registrar/invoices'
page.should have_text('invoices index')
end
it 'should get domains index page' do
visit '/registrar/invoices'
page.should have_text('invoices index')
end
end
end