Skip to content

Instantly share code, notes, and snippets.

View buurzx's full-sized avatar
🎯
Focusing

Pavel Romanov buurzx

🎯
Focusing
  • Earth
View GitHub Profile
require 'spec_helper'
describe Account::PhoneVerificationService do
let(:verification_code) { SecureRandom.hex(5) }
let!(:account) { create(:account, phone_verification_code: verification_code, phone_verification_sent_at: 2.hours.ago) }
let(:service) { Account::PhoneVerificationService.new(account) }
describe '#verify' do
describe 'with valid code' do
it 'should be success' do
class Account::PhoneVerificationService
attr_reader :account, :errors
MAX_FAILED_ATTEMPTS = 3
def initialize(account)
@account = account
end
def verify(code)
@buurzx
buurzx / phone_verification_delivery_service.rb
Created April 18, 2016 07:57
PhoneVerificationDeliveryService
class Account::PhoneVerificationDeliveryService
PHONE_NUMBER = Rails.application.secrets.twilio['phone_number'] if Rails.application.secrets.twilio
attr_reader :account, :errors
def initialize(account)
@account = account
@errors = []
end
h4
= fa_icon('arrow-circle-o-down', text: 'Получатель')
.form-group
// юридическое лицо
label.radio-inline
= radio_button_tag :'order[recipient_attributes][individual]', '0', false, :'ng-model' => 'order.recipient.individual', :'ng-click'=> 'choose_recipient_in_address =false'
| Юридическое лицо
// физическое лицо
label.radio-inline