diff --git a/app/views/application/_form_errors.html.erb b/app/views/application/_form_errors.html.erb new file mode 100644 index 000000000..0f898c81d --- /dev/null +++ b/app/views/application/_form_errors.html.erb @@ -0,0 +1,11 @@ +<% if target.errors.any? %> +
+

<%= pluralize(target.errors.count, 'error') %> prohibited this <%= target.model_name.human.downcase %> from being saved:

+ + +
+<% end %> diff --git a/spec/requests/epp/domain/renew/limit_spec.rb b/spec/requests/epp/domain/renew/limit_spec.rb deleted file mode 100644 index c8fbee7f0..000000000 --- a/spec/requests/epp/domain/renew/limit_spec.rb +++ /dev/null @@ -1,92 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'EPP domain:renew' do - let(:user) { FactoryGirl.create(:api_user_epp, registrar: registrar) } - let(:registrar) { FactoryGirl.create(:registrar) } - subject(:response_xml) { Nokogiri::XML(response.body) } - subject(:response_code) { response_xml.xpath('//xmlns:result').first['code'] } - subject(:response_description) { response_xml.css('result msg').text } - - before :example do - travel_to Time.zone.parse('05.07.2010') - sign_in_to_epp_area(user: user) - FactoryGirl.create(:account, registrar: registrar, balance: 1) - Setting.days_to_renew_domain_before_expire = 0 - - FactoryGirl.create(:pricelist, - category: 'com', - duration: '3years', - price: 1.to_money, - operation_category: 'renew', - valid_from: Time.zone.parse('05.07.2010'), - valid_to: Time.zone.parse('05.07.2010') - ) - end - - context 'when domain can be renewed' do - let!(:domain) { FactoryGirl.create(:domain, - registrar: registrar, - name: 'test.com', - expire_time: Time.zone.parse('05.07.2010')) - } - let(:request_xml) { <<-XML - - - - - - test.com - 2010-07-05 - 3 - - - - - XML - } - - it 'returns epp code of 1000' do - post '/epp/command/renew', frame: request_xml - expect(response_code).to eq('1000') - end - - it 'returns epp description' do - post '/epp/command/renew', frame: request_xml - expect(response_description).to eq('Command completed successfully') - end - end - - context 'when domain cannot be renewed' do - let!(:domain) { FactoryGirl.create(:domain, - registrar: registrar, - name: 'test.com', - expire_time: Time.zone.parse('05.07.2011')) - } - let(:request_xml) { <<-XML - - - - - - test.com - 2011-07-05 - 3 - - - - - XML - } - - it 'returns epp code of 2105' do - post '/epp/command/renew', frame: request_xml - expect(response_code).to eq('2105') - end - - it 'returns epp description' do - post '/epp/command/renew', frame: request_xml - expect(response_description).to eq('Object is not eligible for renewal; ' \ - 'Expiration date must be before 2014-07-05') - end - end -end