This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Account::PhoneVerificationService | |
| attr_reader :account, :errors | |
| MAX_FAILED_ATTEMPTS = 3 | |
| def initialize(account) | |
| @account = account | |
| end | |
| def verify(code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder