From 36e4f2ddc91958f234fd84ccf2c8bd2e7ee7eea1 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Thu, 2 Jul 2015 17:57:49 +0300 Subject: [PATCH] Fix some tests #2741 --- app/models/registrar.rb | 8 ++++++++ spec/epp/domain_spec.rb | 3 +++ spec/fabricators/pricelist_fabricator.rb | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/models/registrar.rb b/app/models/registrar.rb index e2a3f7e4d..5d89816d8 100644 --- a/app/models/registrar.rb +++ b/app/models/registrar.rb @@ -131,6 +131,14 @@ class Registrar < ActiveRecord::Base ) end + def credit!(sum, description) + cash_account.account_activities.create!( + sum: sum, + currency: 'EUR', + description: description + ) + end + def domain_transfers at = DomainTransfer.arel_table DomainTransfer.where( diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index c9bb99451..fae65e7f6 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -5,7 +5,9 @@ describe 'EPP Domain', epp: true do @xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd')) @epp_xml = EppXml.new(cl_trid: 'ABC-12345') @registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1') + @registrar1.credit!(10000, '') @registrar2 = Fabricate(:registrar2, code: 'REGDOMAIN2') + @registrar2.credit!(10000, '') Fabricate(:api_user, username: 'registrar1', registrar: @registrar1) Fabricate(:api_user, username: 'registrar2', registrar: @registrar2) @@ -17,6 +19,7 @@ describe 'EPP Domain', epp: true do Fabricate(:contact, code: 'FIXED:JURIDICAL_1234', ident_type: 'bic') Fabricate(:reserved_domain) Fabricate(:blocked_domain) + Fabricate(:pricelist) @uniq_no = proc { @i ||= 0; @i += 1 } end diff --git a/spec/fabricators/pricelist_fabricator.rb b/spec/fabricators/pricelist_fabricator.rb index 296c3b5fb..36e24b0c8 100644 --- a/spec/fabricators/pricelist_fabricator.rb +++ b/spec/fabricators/pricelist_fabricator.rb @@ -1,8 +1,8 @@ Fabricator(:pricelist) do valid_from 1.year.ago valid_to 1.year.since - category '.ee' + category 'ee' duration '1year' - operation_category 'new' + operation_category 'create' price 10 end