mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
parent
fb584778fd
commit
e4ae71b308
2 changed files with 37 additions and 0 deletions
|
@ -257,6 +257,20 @@ class Contact < ActiveRecord::Base
|
|||
def emails
|
||||
pluck(:email)
|
||||
end
|
||||
|
||||
def address_processing
|
||||
Setting.address_processing
|
||||
end
|
||||
|
||||
def address_attributes
|
||||
%i(
|
||||
city
|
||||
street
|
||||
zip
|
||||
country_code
|
||||
state
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def roid
|
||||
|
|
|
@ -383,4 +383,27 @@ RSpec.describe Contact, db: false do
|
|||
expect(described_class.emails).to eq('emails')
|
||||
end
|
||||
end
|
||||
|
||||
describe '::address_processing' do
|
||||
before do
|
||||
Setting.address_processing = 'test'
|
||||
end
|
||||
|
||||
it 'returns setting value' do
|
||||
expect(described_class.address_processing).to eq('test')
|
||||
end
|
||||
end
|
||||
|
||||
describe '::address_attributes', db: false do
|
||||
it 'returns address attributes' do
|
||||
attributes = %i(
|
||||
city
|
||||
street
|
||||
zip
|
||||
country_code
|
||||
state
|
||||
)
|
||||
expect(described_class.address_attributes).to eq(attributes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue