mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 04:07:33 +02:00
Improve readability
This commit is contained in:
parent
8b7a633290
commit
c0da37f421
2 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,8 @@ class ReservedDomain < ActiveRecord::Base
|
|||
|
||||
validates :name, domain_name: true, uniqueness: true
|
||||
|
||||
alias_attribute :registration_code, :password
|
||||
|
||||
class << self
|
||||
def pw_for(domain_name)
|
||||
name_in_ascii = SimpleIDN.to_ascii(domain_name)
|
||||
|
|
|
@ -8,4 +8,9 @@ class ReservedDomainTest < ActiveSupport::TestCase
|
|||
def test_fixture_is_valid
|
||||
assert @reserved_domain.valid?
|
||||
end
|
||||
|
||||
def test_aliases_registration_code_to_password
|
||||
reserved_domain = ReservedDomain.new(password: 'reserved-001')
|
||||
assert_equal 'reserved-001', reserved_domain.registration_code
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue