Merge branch 'master' of github.com:domify/registry

This commit is contained in:
Martin Lensment 2015-08-11 10:35:49 +03:00
commit beaf8fc7b6
27 changed files with 257 additions and 87 deletions

View file

@ -7,6 +7,7 @@ class Admin::BankTransactionsController < AdminController
end end
def create def create
comma_support_for(:bank_transaction, :sum)
@bank_transaction = BankTransaction.new( @bank_transaction = BankTransaction.new(
bank_transaction_params.merge(bank_statement_id: params[:bank_statement_id]) bank_transaction_params.merge(bank_statement_id: params[:bank_statement_id])
) )
@ -21,6 +22,7 @@ class Admin::BankTransactionsController < AdminController
end end
def update def update
comma_support_for(:bank_transaction, :sum)
if @bank_transaction.update(bank_transaction_params) if @bank_transaction.update(bank_transaction_params)
flash[:notice] = I18n.t('record_updated') flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @bank_transaction] redirect_to [:admin, @bank_transaction]

View file

@ -1,10 +1,18 @@
class Admin::DomainVersionsController < AdminController class Admin::DomainVersionsController < AdminController
load_and_authorize_resource load_and_authorize_resource
# rubocop:disable Style/GuardClause
def index def index
@domain = Domain.find(params[:domain_id]) @domain = Domain.find(params[:domain_id])
@versions = @domain.versions @versions = @domain.versions
if @domain.pending_json.present?
frame = Nokogiri::XML(@domain.pending_json['frame'])
@pending_user = User.find(@domain.pending_json['current_user_id'])
@pending_domain = Epp::Domain.new_from_epp(frame, @pending_user)
end end
end
# rubocop:enable Style/GuardClause
# def index # def index
# # @q = DomainVersion.deleted.search(params[:q]) # # @q = DomainVersion.deleted.search(params[:q])

View file

@ -83,7 +83,7 @@ class Admin::DomainsController < AdminController
def domain_params def domain_params
if params[:domain] if params[:domain]
params.require(:domain).permit({ statuses: [] }) params.require(:domain).permit({ statuses: [], status_notes_array: [] })
else else
{ statuses: [] } { statuses: [] }
end end

View file

@ -17,6 +17,7 @@ class Admin::PricelistsController < AdminController
end end
def create def create
comma_support_for(:pricelist, :price)
@pricelist = Pricelist.new(pricelist_params) @pricelist = Pricelist.new(pricelist_params)
if @pricelist.save if @pricelist.save
@ -27,6 +28,7 @@ class Admin::PricelistsController < AdminController
end end
def update def update
comma_support_for(:pricelist, :price)
if @pricelist.update_attributes(pricelist_params) if @pricelist.update_attributes(pricelist_params)
redirect_to admin_pricelists_url redirect_to admin_pricelists_url
else else

View file

@ -70,4 +70,10 @@ class ApplicationController < ActionController::Base
return 'public' if user.nil? return 'public' if user.nil?
"#{user.id}-#{user.class}: #{user.username}" "#{user.id}-#{user.class}: #{user.username}"
end end
def comma_support_for(parent_key, key)
return if params[parent_key].blank?
return if params[parent_key][key].blank?
params[parent_key][key].sub!(/,/, '.')
end
end end

View file

@ -45,4 +45,14 @@ module ApplicationHelper
# can be api user or some other user # can be api user or some other user
link_to(model.updator, ['admin', model.updator]) link_to(model.updator, ['admin', model.updator])
end end
def currency(amount)
amount ||= 0
format("%01.2f", amount.round(2)).sub(/\./, ',')
end
def plain_username(username)
username ||= ''
username.split(':').last.to_s.strip
end
end end

View file

@ -23,6 +23,10 @@ class Deposit
false false
end end
def amount
BigDecimal.new(@amount.to_s.sub(/,/, '.'))
end
def issue_prepayment_invoice def issue_prepayment_invoice
valid? && registrar.issue_prepayment_invoice(amount, description) valid? && registrar.issue_prepayment_invoice(amount, description)
end end

View file

@ -546,6 +546,7 @@ class Domain < ActiveRecord::Base
self.delete_at = outzone_at + Setting.redemption_grace_period.days self.delete_at = outzone_at + Setting.redemption_grace_period.days
end end
# rubocop:disable Metrics/AbcSize
def set_force_delete def set_force_delete
self.statuses_backup = statuses self.statuses_backup = statuses
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED) statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
@ -572,6 +573,7 @@ class Domain < ActiveRecord::Base
self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
save(validate: false) save(validate: false)
end end
# rubocop:enable Metrics/AbcSize
def unset_force_delete def unset_force_delete
s = [] s = []
@ -681,5 +683,13 @@ class Domain < ActiveRecord::Base
def update_whois_record def update_whois_record
whois_record.blank? ? create_whois_record : whois_record.save whois_record.blank? ? create_whois_record : whois_record.save
end end
def status_notes_array=(notes)
self.status_notes = {}
notes ||= []
statuses.each_with_index do |status, i|
status_notes[status] = notes[i]
end
end
end end
# rubocop: enable Metrics/ClassLength # rubocop: enable Metrics/ClassLength

View file

@ -63,7 +63,7 @@
%tr %tr
%td= link_to(l(x.paid_at, format: :date_long), [:admin, x]) %td= link_to(l(x.paid_at, format: :date_long), [:admin, x])
%td= x.buyer_name %td= x.buyer_name
%td= x.sum %td= currency(x.sum)
%td= x.currency %td= x.currency
- c = x.binded? ? 'text-success' : 'text-danger' - c = x.binded? ? 'text-success' : 'text-danger'
%td{class: c}= x.binded? ? t(:binded) : t(:not_binded) %td{class: c}= x.binded? ? t(:binded) : t(:not_binded)

View file

@ -18,7 +18,7 @@
.form-group .form-group
= f.label :sum, class: 'col-md-4 control-label required' = f.label :sum, class: 'col-md-4 control-label required'
.col-md-8 .col-md-8
= f.text_field(:sum, class: 'form-control', required: true) = f.text_field(:sum, value: currency(f.object.sum), class: 'form-control', required: true)
.form-group .form-group
= f.label :reference_no, class: 'col-md-4 control-label required' = f.label :reference_no, class: 'col-md-4 control-label required'

View file

@ -36,7 +36,7 @@
%dd= @bank_transaction.description %dd= @bank_transaction.description
%dt= t(:sum) %dt= t(:sum)
%dd= @bank_transaction.sum %dd= currency(@bank_transaction.sum)
%dt= t(:currency) %dt= t(:currency)
%dd= @bank_transaction.currency %dd= @bank_transaction.currency

View file

@ -1,16 +1,37 @@
- if version.present? && domain.present? - version ||= false
- domain ||= false
- pending_user ||= false
- if domain.present?
- if version # normal history
- children = HashWithIndifferentAccess.new(version.children) - children = HashWithIndifferentAccess.new(version.children)
- nameservers = children[:nameservers] || [] - nameservers = children[:nameservers] || []
- tech_contacts = children[:tech_contacts] || [] - tech_contacts = children[:tech_contacts] || []
- admin_contacts = children[:admin_contacts] || [] - admin_contacts = children[:admin_contacts] || []
- registrant = children[:registrant] || [] - registrant = children[:registrant] || []
- event = version.event
- creator = plain_username(version.terminator)
- elsif pending_user # pending history
- nameservers = domain.nameservers
- tech_contacts = domain.tech_contacts
- admin_contacts = domain.admin_contacts
- registrant = [domain.registrant]
- event = 'PENDING'
- creator = pending_user.try(:username)
- else # if legacy data not presentable
- nameservers = []
- tech_contacts = []
- admin_contacts = []
- registrant = []
- event = 'Log data is not viewable'
- creator = ''
%td %td
%p.nowrap %p.nowrap
= l(domain.updated_at, format: :short) = l(domain.updated_at, format: :short)
= version.event = event
%p.text-right %p.text-right
= version.terminator = creator
%td %td
%p %p

View file

@ -17,6 +17,11 @@
%th{class: 'col-xs-2'}= t(:registrar) %th{class: 'col-xs-2'}= t(:registrar)
%tbody %tbody
- if @pending_domain.present?
%tr.small
= render 'admin/domain_versions/version',
domain: @pending_domain, pending_user: @pending_user
- if @domain.versions.present? - if @domain.versions.present?
%tr.small %tr.small
= render 'admin/domain_versions/version', = render 'admin/domain_versions/version',

View file

@ -1,4 +1,5 @@
- content_for :actions do - content_for :actions do
= link_to(t(:add_new_status), '#', class: 'btn btn-primary js-add-status')
= link_to(t(:back_to_domain), [:admin, @domain], class: 'btn btn-default') = link_to(t(:back_to_domain), [:admin, @domain], class: 'btn btn-default')
= render 'shared/title', name: "#{t(:edit)}: #{@domain.name}" = render 'shared/title', name: "#{t(:edit)}: #{@domain.name}"

View file

@ -1,29 +1,41 @@
#domain-statuses #js-statuses
- @server_statuses.each do |x| - f.object.statuses.each do |s|
- disabled = !DomainStatus::SERVER_STATUSES.include?(s)
- disabled_style = disabled ? 'display: none' : ''
- delete_style = [DomainStatus::OK].include?(s) ? 'display: none' : ''
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t(:status) .pull-left= t(:status)
.pull-right .pull-right
= link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-status') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs js-destroy-status', style: delete_style)
= link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy-status')
.panel-body .panel-body
.form-group .form-group
= f.label 'status', class: 'col-md-2 control-label' = f.label 'status', class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= select_tag 'domain[statuses][]', options_for_select(DomainStatus.statuses_for_admin, x), include_blank: true, class: 'form-control' .js-select{style: disabled_style}
= select_tag 'domain[statuses][]',
options_for_select(DomainStatus.statuses_for_admin, s),
include_blank: true, class: "form-control"
- if disabled
.disabled-value.js-disabled-value
= s
= hidden_field_tag 'domain[statuses][]', s, readonly: true
.form-group .form-group
= label_tag t(:description), nil, class: 'col-md-2 control-label' = label_tag t(:notes), nil, class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= text_field_tag :description, nil, class: 'form-control', autocomplete: 'off' - value = f.object.new_record? ? '' : f.object.status_notes[s]
- @other_statuses.each do |x| = text_field_tag 'domain[status_notes_array][]', value, class: 'form-control'
= hidden_field_tag 'domain[statuses][]', x, readonly: true
:coffee
$("#domain-statuses").nestedAttributes
bindAddTo: $(".add-domain-status")
$('.destroy-status').on 'click', (e) -> :coffee
$("#js-statuses").nestedAttributes
bindAddTo: $(".js-add-status")
afterAdd: (el) ->
if el.find('.js-disabled-value')
el.find('.js-disabled-value').remove()
el.find('.js-select').show()
el.find('.js-destroy-status').show()
$(document).on 'click', '.js-destroy-status', (e) ->
e.preventDefault() e.preventDefault()
if $('.panel').length > 1
$(this).parents('.panel').remove() $(this).parents('.panel').remove()
else
$(this).parents('.panel').find('select').val('')

View file

@ -6,9 +6,13 @@
%thead %thead
%tr %tr
%th{class: 'col-xs-6'}= t(:status) %th{class: 'col-xs-6'}= t(:status)
%th{class: 'col-xs-6'}= t(:description) %th{class: 'col-xs-6'}= t(:notes)
%tbody %tbody
- @domain.statuses.each do |x| - @domain.statuses.each do |status|
%tr %tr
%td= x
%td %td
- if [DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE].include? status
= link_to status, admin_domain_domain_versions_path(@domain.id)
- else
= status
%td= @domain.status_notes[status]

View file

@ -15,7 +15,7 @@
.form-group .form-group
= f.label :price = f.label :price
.input-group .input-group
= f.text_field(:price, class: 'form-control') = f.text_field(:price, value: currency(f.object.price), class: 'form-control')
%span.input-group-addon= Money.default_currency %span.input-group-addon= Money.default_currency
.form-group.input-daterange .form-group.input-daterange
= f.label :valid_from, t(:valid) = f.label :valid_from, t(:valid)

View file

@ -33,7 +33,7 @@
%td= pricelist.category %td= pricelist.category
%td= pricelist.duration %td= pricelist.duration
%td= pricelist.operation_category %td= pricelist.operation_category
%td= pricelist.price %td= currency(pricelist.price)
%td= l(pricelist.valid_from, format: :ydate) %td= l(pricelist.valid_from, format: :ydate)
%td= l(pricelist.valid_to, format: :ydate) %td= l(pricelist.valid_to, format: :ydate)
%td= link_to(t(:edit), edit_admin_pricelist_path(pricelist), class: 'btn btn-xs btn-primary') %td= link_to(t(:edit), edit_admin_pricelist_path(pricelist), class: 'btn btn-xs btn-primary')

View file

@ -11,7 +11,7 @@
= Country.new(f.object.ident_country_code).try(:to_s) = Country.new(f.object.ident_country_code).try(:to_s)
= " [#{f.object.ident_country_code}]" = " [#{f.object.ident_country_code}]"
- else - else
- country_selected = @contact.persisted? ? '' : 'EE' - country_selected = @contact.persisted? ? '' : (params[:depp_contact].try(:[], :ident_country_code) || 'EE')
= f.select(:ident_country_code, SortedCountry.all_options(country_selected), {}, = f.select(:ident_country_code, SortedCountry.all_options(country_selected), {},
class: 'js-ident-country-code', required: true) class: 'js-ident-country-code', required: true)
@ -24,7 +24,7 @@
= Depp::Contact.type_string(f.object.ident_type) = Depp::Contact.type_string(f.object.ident_type)
= " [#{f.object.ident_type}]" = " [#{f.object.ident_type}]"
- else - else
- type_selected = @contact.persisted? ? '' : 'bic' - type_selected = @contact.persisted? ? '' : (params[:depp_contact].try(:[], :ident_type) || 'bic')
= f.select(:ident_type, Depp::Contact::SELECTION_TYPES, = f.select(:ident_type, Depp::Contact::SELECTION_TYPES,
{ selected: type_selected }, { selected: type_selected },
class: 'js-ident-type', required: true) class: 'js-ident-type', required: true)
@ -33,7 +33,7 @@
.col-md-3.control-label .col-md-3.control-label
= f.label :ident, t(:ident) + '*' = f.label :ident, t(:ident) + '*'
.col-md-7 .col-md-7
- if f.object.ident.present? - if @contact.persisted? && f.object.ident.present?
.disabled-value .disabled-value
= f.object.ident = f.object.ident
- else - else

View file

@ -14,19 +14,19 @@
%tr %tr
%td= t(x.description) %td= t(x.description)
%td= x.unit %td= x.unit
%td= x.amount %td= currency(x.amount)
%td= x.price %td= currency(x.price)
%td= x.item_sum_without_vat %td= currency(x.item_sum_without_vat)
%tfoot %tfoot
%tr %tr
%th{colspan: 3} %th{colspan: 3}
%th= t(:total_without_vat) %th= t(:total_without_vat)
%td= @invoice.sum_without_vat %td= currency(@invoice.sum_without_vat)
%tr %tr
%th.no-border{colspan: 3} %th.no-border{colspan: 3}
%th= t('vat', vat_prc: (@invoice.vat_prc * 100).round) %th= t('vat', vat_prc: (@invoice.vat_prc * 100).round)
%td= @invoice.vat %td= currency(@invoice.vat)
%tr %tr
%th.no-border{colspan: 3} %th.no-border{colspan: 3}
%th= t(:total) %th= t(:total)
%td= @invoice.sum %td= currency(@invoice.sum)

View file

@ -229,22 +229,22 @@
%tr %tr
%td= t(x.description) %td= t(x.description)
%td= x.unit %td= x.unit
%td= x.amount %td= currency(x.amount)
%td= x.price %td= currency(x.price)
%td= "#{x.item_sum_without_vat} #{@invoice.currency}" %td= "#{currency(x.item_sum_without_vat)} #{@invoice.currency}"
%tfoot %tfoot
%tr %tr
%th{colspan: 3} %th{colspan: 3}
%th= t(:total_without_vat) %th= t(:total_without_vat)
%td= "#{@invoice.sum_without_vat} #{@invoice.currency}" %td= "#{currency(@invoice.sum_without_vat)} #{@invoice.currency}"
%tr %tr
%th.no-border{colspan: 3} %th.no-border{colspan: 3}
%th= t('vat', vat_prc: (@invoice.vat_prc * 100).round) %th= t('vat', vat_prc: (@invoice.vat_prc * 100).round)
%td= "#{@invoice.vat} #{@invoice.currency}" %td= "#{currency(@invoice.vat)} #{@invoice.currency}"
%tr %tr
%th.no-border{colspan: 3} %th.no-border{colspan: 3}
%th= t(:total) %th= t(:total)
%td= "#{@invoice.sum} #{@invoice.currency}" %td= "#{currency(@invoice.sum)} #{@invoice.currency}"
#footer #footer
%hr %hr

View file

@ -1,30 +1,47 @@
#
# Registry servers configuration
#
#
# Be sure to restart your server when you modify settings. # Be sure to restart your server when you modify settings.
#
#
# SMTP configuration (for Admin/EPP/Registrar/Registrant servers)
#
smtp_address: 'server-hostname'
smtp_port: '25' # 587, 465
smtp_user_name: 'login'
smtp_password: 'pw/key'
# If you need to specify a HELO domain, you can do it here.
smtp_domain: '' # 'domain for HELO checking'
# Use "none" only when for a self-signed and/or wildcard certificate
smtp_openssl_verify_mode: 'peer' # 'none', 'peer', 'client_once','fail_if_no_peer_cert'
# Detects if STARTTLS is enabled in your SMTP server and starts to use it. Defaults to true.
# Set this to false if there is a problem with your server certificate that you cannot resolve.
smtp_enable_starttls_auto: 'true' # 'false'
# If your mail server requires authentication, please change.
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
registrant_url: 'https:/registrant.example.com' # for valid email body registrant links
#
# ADMIN server
#
app_name: '.EE Registry' app_name: '.EE Registry'
zonefile_export_dir: 'export/zonefiles' zonefile_export_dir: 'export/zonefiles'
bank_statement_import_dir: 'import/bank_statements' bank_statement_import_dir: 'import/bank_statements'
legal_documents_dir: 'import/legal_documents' legal_documents_dir: 'import/legal_documents'
time_zone: 'Tallinn' # more zones by rake time:zones:all time_zone: 'Tallinn' # more zones by rake time:zones:all
# New Relic app name, keep only current mode, remove other names.
# Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic.
new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant'
new_relic_license_key: '42d1c2ba4ed17a9cf6297c59d80e563a3dd3c4fa'
# You can use `rake secret` to generate a secure secret key.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
secret_key_base: 'please-change-it-you-can-generate-it-with-rake-secret'
devise_secret: 'please-change-it-you-can-generate-it-with-rake-secret'
# Admin server configuration:
openssl_config_path: '/etc/ssl/openssl.cnf' openssl_config_path: '/etc/ssl/openssl.cnf'
crl_dir: '/home/registry/registry/shared/ca/crl' crl_dir: '/home/registry/registry/shared/ca/crl'
ca_cert_path: '/home/registry/registry/shared/ca/certs/ca.crt.pem' ca_cert_path: '/home/registry/registry/shared/ca/certs/ca.crt.pem'
ca_key_path: '/home/registry/registry/shared/ca/private/ca.key.pem' ca_key_path: '/home/registry/registry/shared/ca/private/ca.key.pem'
ca_key_password: 'your-root-key-password' ca_key_password: 'your-root-key-password'
# EPP server configuration
#
# EPP
#
webclient_ips: '127.0.0.1,0.0.0.0' #ips, separated with commas webclient_ips: '127.0.0.1,0.0.0.0' #ips, separated with commas
webclient_cert_common_name: 'webclient' webclient_cert_common_name: 'webclient'
# Contact epp will not accept org value by default # Contact epp will not accept org value by default
@ -41,7 +58,10 @@ contact_org_enabled: 'false'
# Custom legal document types # Custom legal document types
# legal_document_types: "pdf,bdoc,ddoc,zip,rar,gz,tar,7z,odt,doc,docx" # legal_document_types: "pdf,bdoc,ddoc,zip,rar,gz,tar,7z,odt,doc,docx"
# DEPP server configuration (both for Registrar/Registrant servers)
#
# REGISTRAR configuration (DEPP)
#
show_ds_data_fields: 'false' show_ds_data_fields: 'false'
default_nameservers_count: '2' default_nameservers_count: '2'
default_admin_contacts_count: '1' default_admin_contacts_count: '1'
@ -51,30 +71,40 @@ key_path: '/home/registry/registry/shared/ca/private/webclient.key.pem'
epp_hostname: 'registry.gitlab.eu' epp_hostname: 'registry.gitlab.eu'
repp_url: 'https://repp.gitlab.eu/repp/v1/' repp_url: 'https://repp.gitlab.eu/repp/v1/'
# Registrant server configuration
#
# REGISTRANT configuration
#
restful_whois_url: 'https://restful-whois.example.com' restful_whois_url: 'https://restful-whois.example.com'
# SMTP configuration (for Admin/EPP/Registrar/Registrant servers)
smtp_address: 'server-hostname' #
smtp_port: '25' # 587, 465 # REGISTRAR AND REGISTRANT
smtp_user_name: 'login' #
smtp_password: 'pw/key'
# If you need to specify a HELO domain, you can do it here.
smtp_domain: '' # 'domain for HELO checking'
# Use "none" only when for a self-signed and/or wildcard certificate
smtp_openssl_verify_mode: 'peer' # 'none', 'peer', 'client_once','fail_if_no_peer_cert'
# Detects if STARTTLS is enabled in your SMTP server and starts to use it. Defaults to true.
# Set this to false if there is a problem with your server certificate that you cannot resolve.
smtp_enable_starttls_auto: 'true' # 'false'
# If your mail server requires authentication, please change.
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
registrant_url: 'https:/registrant.example.com' # for valid email body registrant links
# SK DigiDocService # SK DigiDocService
sk_digi_doc_service_endpoint: 'https://openxades.org:9443/DigiDocService' sk_digi_doc_service_endpoint: 'https://openxades.org:9443/DigiDocService'
sk_digi_doc_service_name: 'EIS test' sk_digi_doc_service_name: 'EIS test'
# Autotest config overwrites
#
# MISC
#
# New Relic app name, keep only current mode, remove other names.
# Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic.
new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant'
new_relic_license_key: '42d1c2ba4ed17a9cf6297c59d80e563a3dd3c4fa'
# You can use `rake secret` to generate a secure secret key.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
secret_key_base: 'please-change-it-you-can-generate-it-with-rake-secret'
devise_secret: 'please-change-it-you-can-generate-it-with-rake-secret'
#
# AUTOTEST overwrites
#
test: test:
webclient_ips: '127.0.0.1' # it should match to localhost ip address webclient_ips: '127.0.0.1' # it should match to localhost ip address
crl_dir: '/var/lib/jenkins/workspace/registry/ca/crl' crl_dir: '/var/lib/jenkins/workspace/registry/ca/crl'
@ -84,7 +114,21 @@ test:
ca_key_password: 'test' ca_key_password: 'test'
cert_path: '/var/lib/jenkins/workspace/registry/ca/certs/webclient.crt.pem' cert_path: '/var/lib/jenkins/workspace/registry/ca/certs/webclient.crt.pem'
# DEPP # Registrar/DEPP
key_path: '/var/lib/jenkins/workspace/registry/ca/private/webclient.key.pem' key_path: '/var/lib/jenkins/workspace/registry/ca/private/webclient.key.pem'
epp_hostname: '127.0.0.1' epp_hostname: '127.0.0.1'
repp_url: 'http://127.0.0.1:8989/repp/v1/' repp_url: 'http://127.0.0.1:8989/repp/v1/'
#
# DEVELOPMENT overwrites
#
development:
epp_hostname: '127.0.0.1'
repp_url: 'http://127.0.0.1:8080/repp/v1/'
cert_path: 'ca/certs/webclient.cert.pem'
key_path: 'ca/private/webclient.key.pem'
crl_dir: 'ca/crl'
ca_cert_path: 'ca/certs/ca.crt.pem'
ca_key_path: 'ca/private/ca.key.pem'
ca_key_password: 'your-root-key-password'

View file

@ -46,7 +46,7 @@ feature 'BankStatement', type: :feature do
click_link 'Back to bank statement' click_link 'Back to bank statement'
page.should have_content('120.0') page.should have_content('120,00')
page.should have_content('Test buyer') page.should have_content('Test buyer')
end end
end end

View file

@ -37,7 +37,7 @@ feature 'Invoice', type: :feature do
page.should have_content('Record created') page.should have_content('Record created')
page.should have_content('Invoice no.') page.should have_content('Invoice no.')
page.should have_content('Prepayment') page.should have_content('Prepayment')
page.should have_content('120.0') page.should have_content('120,00')
page.should have_content(r.name) page.should have_content(r.name)
end end
@ -107,7 +107,7 @@ feature 'Invoice', type: :feature do
page.should have_content('689') page.should have_content('689')
page.should have_content('EE557700771000598731') page.should have_content('EE557700771000598731')
page.should have_content('Not binded', count: 2) page.should have_content('Not binded', count: 2)
page.should have_content(invoice.sum.to_s) page.should have_content('240,00')
page.should have_content('EUR') page.should have_content('EUR')
click_link 'Bind invoices' click_link 'Bind invoices'
@ -120,7 +120,7 @@ feature 'Invoice', type: :feature do
page.should have_content('Binded') page.should have_content('Binded')
page.should have_content(invoice.to_s) page.should have_content(invoice.to_s)
page.should have_content(invoice.sum.to_s) page.should have_content('240,00')
page.should have_content(invoice.reference_no) page.should have_content(invoice.reference_no)
page.should have_content(I18n.l(paid_at, format: :date_long)) page.should have_content(I18n.l(paid_at, format: :date_long))

View file

@ -0,0 +1,39 @@
require 'rails_helper'
describe Deposit do
context 'with invalid attribute' do
before :all do
@deposit = Deposit.new
end
it 'should not be valid' do
@deposit.valid?
@deposit.errors.full_messages.should match_array([
"Registrar is missing"
])
end
it 'should have 0 amount' do
@deposit.amount.should == 0
end
it 'should not be presisted' do
@deposit.persisted?.should == false
end
it 'should replace comma with point for 0' do
@deposit.amount = '0,0'
@deposit.amount.should == 0.0
end
it 'should replace comma with points' do
@deposit.amount = '10,11'
@deposit.amount.should == 10.11
end
it 'should work with float as well' do
@deposit.amount = 0.123
@deposit.amount.should == 0.123
end
end
end

View file

@ -239,7 +239,7 @@ describe Domain do
DomainStatus::CLIENT_HOLD, DomainStatus::CLIENT_HOLD,
DomainStatus::EXPIRED, DomainStatus::EXPIRED,
DomainStatus::SERVER_HOLD, DomainStatus::SERVER_HOLD,
DomainStatus::DELETE_CANDIDATE, DomainStatus::DELETE_CANDIDATE
] ]
@domain.save @domain.save

View file

@ -41,7 +41,9 @@ describe ZonefileSetting do
it 'should not place serverHold nor clientHold domains into zonefile' do it 'should not place serverHold nor clientHold domains into zonefile' do
Fabricate(:zonefile_setting) Fabricate(:zonefile_setting)
d = Fabricate(:domain_with_dnskeys, name: 'testzone.ee', statuses: ['serverHold', 'serverDeleteProhibited', 'clientHold']) d = Fabricate(:domain_with_dnskeys,
name: 'testzone.ee',
statuses: ['serverHold', 'serverDeleteProhibited', 'clientHold'])
d.nameservers << Nameserver.new({ d.nameservers << Nameserver.new({
hostname: "ns.#{d.name}", hostname: "ns.#{d.name}",
ipv4: '123.123.123.123', ipv4: '123.123.123.123',