Skip to content

Commit 811e390

Browse files
committed
Provide type codes for :not_found, :server_error, :successful
1 parent 2196e44 commit 811e390

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rspec/rails/matchers/have_http_status.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ def type_codes
342342
# @see https://github.com/rails/rails/blob/ca200378/actionpack/lib/action_dispatch/http/response.rb#L74
343343
# @see https://github.com/rack/rack/blob/ce4a3959/lib/rack/response.rb#L119-L122
344344
@type_codes ||= case expected
345-
when :error
345+
when :error, :server_error
346346
"5xx"
347-
when :success
347+
when :success, :successful
348348
"2xx"
349-
when :missing
349+
when :missing, :not_found
350350
"404"
351351
when :redirect
352352
"3xx"

0 commit comments

Comments
 (0)