Merge branch 'master' into registry-475

This commit is contained in:
Artur Beljajev 2017-05-03 13:25:16 +03:00
commit ffd9f28aee
11 changed files with 72 additions and 16 deletions

View file

@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.feature 'New domain in registrar area', settings: false do
background do
sign_in_to_registrar_area
end
it 'has default period' do
visit registrar_domains_path
click_link_or_button t('new')
expect(page).to have_field('domain_period', with: Depp::Domain.default_period)
end
end

View file

@ -0,0 +1,18 @@
require 'rails_helper'
RSpec.feature 'Renew domain in registrar area' do
given!(:registrar) { create(:registrar) }
given!(:user) { create(:api_user, registrar: registrar) }
given!(:domain) { create(:domain, registrar: registrar) }
background do
sign_in_to_registrar_area(user: user)
end
it 'has default period' do
visit registrar_domains_path
click_link_or_button t('renew')
expect(page).to have_field('period', with: Depp::Domain.default_period)
end
end

View file

@ -0,0 +1,9 @@
require 'rails_helper'
RSpec.describe Depp::Domain do
describe '::default_period', db: false, settings: false do
it 'returns default period' do
expect(described_class.default_period).to eq('1y')
end
end
end

View file

@ -1,4 +1,6 @@
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)
if ENV['TRAVIS']
require 'simplecov'
SimpleCov.start