Skip to content

Commit

Permalink
Merge branch 'master' into 2470-fix-phantom-statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
maricavor authored Nov 10, 2022
2 parents fc99ada + c96a9bd commit f2c9c8f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ GEM
thor (>= 0.14.0, < 2)
globalid (0.5.2)
activesupport (>= 5.0)
google-protobuf (3.19.4)
google-protobuf (3.19.4-x86_64-linux)
google-protobuf (3.21.9)
google-protobuf (3.21.9-x86_64-linux)
googleapis-common-protos-types (1.3.0)
google-protobuf (~> 3.14)
grpc (1.41.1)
Expand Down Expand Up @@ -359,7 +359,7 @@ GEM
paper_trail (13.0.0)
activerecord (>= 5.2)
request_store (~> 1.1)
pdfkit (0.8.7)
pdfkit (0.8.7.2)
pg (1.4.4)
pg_query (2.1.2)
google-protobuf (>= 3.17.1)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/epp/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def respond_with_session_limit_exceeded_error(exception)
code: '2502',
msg: Shunter.default_error_message)
handle_errors
log_exception(exception)
log_exception(exception) unless Rails.env.test?
end

def respond_with_command_failed_error(exception)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/repp/v1/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def log_request
render(json: @response, status: :unauthorized)
rescue Shunter::ThrottleError => e
@response = { code: 2502, message: Shunter.default_error_message }
logger.error e.to_s
logger.error e.to_s unless Rails.env.test?
render(json: @response, status: :bad_request)
ensure
create_repp_log
Expand Down
2 changes: 1 addition & 1 deletion app/lib/shunter/integration/throttle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def throttle
logger.info "Request from #{throttled_user.class}/#{throttled_user.id} is coming through throttling"
yield if block_given?
else
logger.info "Too many requests from #{throttled_user.class}/#{throttled_user.id}."
logger.info "Too many requests from #{throttled_user.class}/#{throttled_user.id}." unless Rails.env.test?
raise Shunter::ThrottleError
end
end
Expand Down
12 changes: 9 additions & 3 deletions test/models/epp/response/result/code_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
require 'test_helper'

class Hash
def contain?(other)
self.merge(other) == self
end
end

class EppResponseResultCodeTest < ActiveSupport::TestCase
def test_creates_code_by_key
key = :completed_successfully
Expand Down Expand Up @@ -84,10 +90,10 @@ def test_returns_default_descriptions
2306 => 'Parameter value policy error',
2308 => 'Data management policy violation',
2400 => 'Command failed',
2501 => 'Authentication error; server closing connection',
2502 => Shunter.default_error_message
2501 => 'Authentication error; server closing connection'
}
assert_equal descriptions, Epp::Response::Result::Code.default_descriptions

assert Epp::Response::Result::Code.default_descriptions.contain? descriptions
end

def test_equality
Expand Down

0 comments on commit f2c9c8f

Please sign in to comment.