mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
parent
5af4c585d4
commit
5e1c43f7cc
5 changed files with 7 additions and 7 deletions
|
@ -17,7 +17,7 @@ module Repp
|
|||
if params[:details] == 'true'
|
||||
contacts = current_user.registrar.contacts.limit(limit).offset(offset)
|
||||
|
||||
unless Contact.address_processing
|
||||
unless Contact.address_processing?
|
||||
attributes = Contact.attribute_names - Contact.address_attribute_names
|
||||
contacts = contacts.select(attributes)
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ class Epp::ContactsController < EppController
|
|||
|
||||
@contact.add_legal_file_to_new(frame)
|
||||
|
||||
@response_code = if Contact.address_processing
|
||||
@response_code = if Contact.address_processing?
|
||||
1000
|
||||
else
|
||||
frame.css('postalInfo addr').size != 0 ? 1100 : 1000
|
||||
|
|
|
@ -258,7 +258,7 @@ class Contact < ActiveRecord::Base
|
|||
pluck(:email)
|
||||
end
|
||||
|
||||
def address_processing
|
||||
def address_processing?
|
||||
Setting.address_processing
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ RSpec.describe Repp::ContactV1, db: true do
|
|||
|
||||
context 'when address processing is enabled' do
|
||||
before do
|
||||
expect(Contact).to receive(:address_processing).and_return(true)
|
||||
expect(Contact).to receive(:address_processing?).and_return(true)
|
||||
get '/repp/v1/contacts', { limit: 1, details: true }, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
end
|
||||
|
||||
|
@ -34,7 +34,7 @@ RSpec.describe Repp::ContactV1, db: true do
|
|||
|
||||
context 'when address processing is disabled' do
|
||||
before do
|
||||
expect(Contact).to receive(:address_processing).and_return(false)
|
||||
expect(Contact).to receive(:address_processing?).and_return(false)
|
||||
get '/repp/v1/contacts', { limit: 1, details: true }, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
end
|
||||
|
||||
|
|
|
@ -384,13 +384,13 @@ RSpec.describe Contact, db: false do
|
|||
end
|
||||
end
|
||||
|
||||
describe '::address_processing' do
|
||||
describe '::address_processing?' do
|
||||
before do
|
||||
Setting.address_processing = 'test'
|
||||
end
|
||||
|
||||
it 'returns setting value' do
|
||||
expect(described_class.address_processing).to eq('test')
|
||||
expect(described_class.address_processing?).to eq('test')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue