Merge branch 'master' into registry-791

# Conflicts:
#	db/structure.sql
This commit is contained in:
Artur Beljajev 2018-07-19 20:40:45 +03:00
commit 106592e53e
58 changed files with 991 additions and 1005 deletions

View file

@ -1,20 +0,0 @@
require 'rails_helper'
RSpec.feature 'Mobile ID login', db: true do
given!(:api_user) { create(:api_user, identity_code: 1234) }
background do
digidoc_client = instance_double(Digidoc::Client, authenticate: OpenStruct.new(user_id_code: 1234), session_code: 1234)
allow(Digidoc::Client).to receive(:new).and_return(digidoc_client)
end
scenario 'login with phone number' do
visit registrar_login_path
click_on 'login-with-mobile-id-btn'
fill_in 'user[phone]', with: '1234'
click_button 'Login'
expect(page).to have_text('Confirmation sms was sent to your phone. Verification code is')
end
end

View file

@ -1,40 +0,0 @@
require 'rails_helper'
RSpec.describe DomainDeleteConfirmEmailJob do
describe '#run' do
let(:domain) { instance_double(Domain) }
let(:message) { instance_double(ActionMailer::MessageDelivery) }
before :example do
expect(Domain).to receive(:find).and_return(domain)
allow(domain).to receive_messages(
id: 1,
name: 'test.com',
registrant_email: 'registrant@test.com',
registrar: 'registrar',
registrant: 'registrant')
end
after :example do
domain_id = 1
described_class.enqueue(domain_id)
end
it 'creates log record' do
log_message = 'Send DomainDeleteMailer#confirm email for domain test.com (#1) to registrant@test.com'
allow(DomainDeleteMailer).to receive(:confirm).and_return(message)
allow(message).to receive(:deliver_now)
expect(Rails.logger).to receive(:info).with(log_message)
end
it 'sends email' do
expect(DomainDeleteMailer).to receive(:confirm).with(domain: domain,
registrar: 'registrar',
registrant: 'registrant')
.and_return(message)
expect(message).to receive(:deliver_now)
end
end
end

View file

@ -1,18 +0,0 @@
require 'rails_helper'
RSpec.describe DomainUpdateConfirmJob do
let(:domain) { instance_spy(Epp::Domain, registrant: registrant, errors: []) }
let(:registrant) { instance_double(Registrant) }
let(:registrant_change) { instance_spy(RegistrantChange) }
it 'confirms registrant change' do
expect(Epp::Domain).to receive(:find).and_return(domain)
expect(RegistrantChange).to receive(:new)
.with(domain: domain, old_registrant: registrant)
.and_return(registrant_change)
described_class.enqueue(domain_id = nil, action = RegistrantVerification::CONFIRMED)
expect(registrant_change).to have_received(:confirm)
end
end

View file

@ -2,7 +2,6 @@ ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'capybara/poltergeist'
require 'paper_trail/frameworks/rspec'
require 'money-rails/test_helpers'
require 'support/requests/session_helpers'

View file

@ -4,5 +4,3 @@ RSpec.configure do |config|
config.include CapybaraViewMacros, type: :view
config.include CapybaraViewMacros, type: :presenter
end
Capybara.javascript_driver = :poltergeist