restful_error 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +22 -0
- data/README.md +124 -0
- data/app/views/restful_error/show.html.erb +4 -0
- data/app/views/restful_error/show.json.erb +7 -0
- data/app/views/restful_error/show.xml.erb +5 -0
- data/config/locales/en.restful_error.yml +14 -0
- data/config/locales/ja.restful_error.yml +13 -0
- data/lib/restful_error/inflector.rb +2 -0
- data/lib/restful_error/railtie.rb +4 -8
- data/lib/restful_error/status.rb +19 -19
- data/lib/restful_error/version.rb +1 -1
- data/lib/restful_error.rb +34 -15
- metadata +9 -7
- data/lib/restful_error/engine.rb +0 -9
- data/spec/rack_spec.rb +0 -20
- data/spec/railtie_spec.rb +0 -18
- data/spec/restful_error_spec.rb +0 -47
- data/spec/spec_helper.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf170d758ce3175fe4b56ec695fbf4be09569474e66b376df7395084b8babda5
|
4
|
+
data.tar.gz: df9042f7e3a5ab6d80b7c861e61f35604f894715226c2b2b87bd4ccbff610ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b649d3d114cfc2dfb0eefd9c96a0e69be07715d3e2c9517dda75b0d80ad0d08e05f07ed968ecb5f74bb51da4b3d68dfdc512097d78c5d030a9343b16d922ad6
|
7
|
+
data.tar.gz: b9440442b318f6d64958c14e0252d26a628cb8545c03d716464f10493e016c9a6848b1636dd6f0321b0bcf605833e3bc20db0188da6096d64177f390a47f896b
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2025 Ohkubo KOHEI
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
[](https://badge.fury.io/rb/restful_error)
|
2
|
+
|
3
|
+
# RestfulError
|
4
|
+
|
5
|
+
Define your error with status code. Raise it and you will get formatted response with i18nized message.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'restful_error'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### Pure ruby
|
20
|
+
```ruby
|
21
|
+
ex = RestfulError[404].new
|
22
|
+
ex.restful.code # => 404
|
23
|
+
ex.restful.reason_phrase # => "Not Found"
|
24
|
+
```
|
25
|
+
|
26
|
+
#### your custom error by subclassing
|
27
|
+
```ruby
|
28
|
+
class ::NoSession < RestfulError[404]; end
|
29
|
+
# or
|
30
|
+
class ::NoSession < RestfulError::NotFound; end
|
31
|
+
```
|
32
|
+
#### your custom error with http_status
|
33
|
+
```ruby
|
34
|
+
class OAuthController < ApplicationController
|
35
|
+
|
36
|
+
# define http_status and include RestfulError::Helper
|
37
|
+
class PermissionError < StandardError
|
38
|
+
include RestfulError::Helper
|
39
|
+
def http_status = 401
|
40
|
+
end
|
41
|
+
# or
|
42
|
+
class PermissionError < StandardError
|
43
|
+
include RestfulError::Helper
|
44
|
+
def http_status; :unauthorized; end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
PermissionError.new.restful.reason_phrase # => "Unauthorized"
|
48
|
+
```
|
49
|
+
|
50
|
+
### With Rails
|
51
|
+
`config.exceptions_app` will automatically set.
|
52
|
+
|
53
|
+
#### raise me in request
|
54
|
+
```ruby
|
55
|
+
class PostsController < ApplicationController
|
56
|
+
before_action do
|
57
|
+
raise RestfulError[401] unless current_user
|
58
|
+
# or
|
59
|
+
raise RestfulError::Unauthorized unless current_user
|
60
|
+
end
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
|
65
|
+
#### Multi format response
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
get '/posts/new'
|
69
|
+
#=> render 'restful_error/show.html' with @status_code and @message
|
70
|
+
|
71
|
+
post '/posts.json'
|
72
|
+
#=> { status_code: 401, message: "Sign in required" } or write your json at 'restful_error/show.json'
|
73
|
+
|
74
|
+
get '/session.xml'
|
75
|
+
#=> "<error><status_code type="integer">401</status_code><message>Sign in required</message></error>" or write your xml at 'restful_error/show.xml'
|
76
|
+
```
|
77
|
+
|
78
|
+
#### I18n
|
79
|
+
|
80
|
+
```yaml
|
81
|
+
ja:
|
82
|
+
restful_error:
|
83
|
+
unauthorized: ログインしてください #401
|
84
|
+
not_found: ページが存在しません #404
|
85
|
+
```
|
86
|
+
|
87
|
+
#### library defined error
|
88
|
+
``` ruby
|
89
|
+
config.action_dispatch.rescue_responses["CanCan::Unauthorized"] = 401
|
90
|
+
# or
|
91
|
+
config.action_dispatch.rescue_responses["CanCan::Unauthorized"] = :unauthorized
|
92
|
+
```
|
93
|
+
#### I18n
|
94
|
+
```yaml
|
95
|
+
ja:
|
96
|
+
restful_error:
|
97
|
+
no_session: セッションがありません
|
98
|
+
oauth_controller/require_twitter_login: Twitterログインが必要です
|
99
|
+
can_can/unauthorized: 権限がありません
|
100
|
+
active_record/record_not_found: 要求されたリソースが存在しません
|
101
|
+
```
|
102
|
+
#### custom message
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
class RequireLogin < StandardError
|
106
|
+
def initialize(provider = 'Unknown')
|
107
|
+
@provider = provider
|
108
|
+
end
|
109
|
+
def status_code
|
110
|
+
:unauthorized
|
111
|
+
end
|
112
|
+
def response_message
|
113
|
+
I18n.t('restful_error.require_login', provider: provider)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
```
|
117
|
+
|
118
|
+
## Contributing
|
119
|
+
|
120
|
+
1. Fork it ( https://github.com/kuboon/restful_error/fork )
|
121
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
122
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
123
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
124
|
+
5. Create a new Pull Request
|
@@ -0,0 +1,14 @@
|
|
1
|
+
en:
|
2
|
+
restful_error:
|
3
|
+
active_record/record_not_found: Requested resource is not found
|
4
|
+
action_controller/routing_error: Requested resource is not found
|
5
|
+
can_can/unauthorized: Unauthorized
|
6
|
+
bad_request: Bad request #400
|
7
|
+
unauthorized: Unauthorized #401
|
8
|
+
forbidden: Forbidden #403
|
9
|
+
not_found: Page not found #404
|
10
|
+
method_not_allowed: Requested HTTP Method is not allowd #405
|
11
|
+
gone: Gone #410
|
12
|
+
unprocessable_content: Content is readable but unprocessable #422
|
13
|
+
internal_server_error: Internal server error #500
|
14
|
+
service_unavailable: Service unavailable #503
|
@@ -0,0 +1,13 @@
|
|
1
|
+
ja:
|
2
|
+
restful_error:
|
3
|
+
active_record/record_not_found: 要求されたリソースが存在しません
|
4
|
+
can_can/unauthorized: 権限がありません
|
5
|
+
bad_request: 不正なリクエスト #400
|
6
|
+
unauthorized: 権限がありません #401
|
7
|
+
forbidden: そのURLへのアクセスは禁止されています #403
|
8
|
+
not_found: そのURLは存在しません #404
|
9
|
+
method_not_allowed: その HTTP method は使用できません #405
|
10
|
+
gone: 要求されたリソースは消滅しました #410
|
11
|
+
unprocessable_content: コンテンツを読みましたが処理できません #422
|
12
|
+
internal_server_error: サーバエラーです #500
|
13
|
+
service_unavailable: サービスが一時的に利用不可能になっています。しばらく時間をおいて、再度ご確認願います。 #503
|
@@ -12,6 +12,7 @@ module RestfulError
|
|
12
12
|
word.gsub!(/(?<=[A-Z])(?=[A-Z][a-z])|(?<=[a-z\d])(?=[A-Z])/, "_")
|
13
13
|
word.tr!("-", "_")
|
14
14
|
word.downcase!
|
15
|
+
word
|
15
16
|
end
|
16
17
|
|
17
18
|
def camelize(word_)
|
@@ -21,6 +22,7 @@ module RestfulError
|
|
21
22
|
word.sub!(/^[a-z\d]*/) { ::Regexp.last_match(0).capitalize }
|
22
23
|
word.gsub!(%r{(?:_|(/))([a-z\d]*)}) { "#{Regexp.last_match(1)}#{Regexp.last_match(2).capitalize}" }
|
23
24
|
word.gsub!("/", "::")
|
25
|
+
word
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -10,18 +10,14 @@ module RestfulError
|
|
10
10
|
|
11
11
|
def show
|
12
12
|
@exception = request.env["action_dispatch.exception"]
|
13
|
-
|
13
|
+
code = request.path_info[1..].to_i
|
14
|
+
status = RestfulError.build_status_from_symbol_or_code(code)
|
14
15
|
@status_code = status.code
|
15
16
|
@reason_phrase = status.reason_phrase
|
16
|
-
@
|
17
|
-
unless @message
|
18
|
-
class_name = @exception.class.name
|
19
|
-
class_key = RestfulError::Inflector.underscore(class_name)
|
20
|
-
@message = I18n.t class_key, default: [ status.symbol, @reason_phrase ], scope: :restful_error
|
21
|
-
end
|
17
|
+
@response_message = @exception.try(:response_message) || RestfulError.localized_phrase(@exception.class.name, status) || nil
|
22
18
|
|
23
19
|
self.status = status.code
|
24
|
-
render "restful_error/show"
|
20
|
+
render "restful_error/show", formats: request.format.symbol
|
25
21
|
end
|
26
22
|
end
|
27
23
|
|
data/lib/restful_error/status.rb
CHANGED
@@ -4,34 +4,34 @@ require "restful_error/inflector"
|
|
4
4
|
require "rack/utils"
|
5
5
|
|
6
6
|
module RestfulError
|
7
|
+
Status = Data.define(:code, :reason_phrase, :symbol, :const_name)
|
8
|
+
|
7
9
|
STATUS_CODE_TO_SYMBOL = Rack::Utils::SYMBOL_TO_STATUS_CODE.invert
|
8
|
-
|
9
|
-
|
10
|
+
|
11
|
+
def self.build_status_from_const(const_sym)
|
12
|
+
const_name = const_sym.to_s
|
13
|
+
return unless /[A-Z]/.match?(const_name[0])
|
14
|
+
symbol = RestfulError::Inflector.underscore(const_name).to_sym
|
15
|
+
build_status_from_symbol_or_code(symbol)
|
16
|
+
end
|
17
|
+
def self.build_status_from_symbol_or_code(code_or_sym)
|
18
|
+
case code_or_sym
|
10
19
|
when Integer
|
11
|
-
|
20
|
+
code = code_or_sym
|
21
|
+
symbol = STATUS_CODE_TO_SYMBOL[code]
|
22
|
+
const_name = Inflector.camelize(symbol.to_s)
|
23
|
+
reason_phrase = Rack::Utils::HTTP_STATUS_CODES[code]
|
24
|
+
Status.new(code:, symbol:, const_name:, reason_phrase:)
|
12
25
|
when Symbol
|
13
|
-
str = code_or_sym_or_const_name.to_s
|
14
|
-
sym = /[A-Z]/.match?(str[0]) ? RestfulError::Inflector.underscore(str).to_sym : code_or_sym_or_const_name
|
15
26
|
begin
|
16
|
-
Rack::Utils.status_code(
|
27
|
+
build_status_from_symbol_or_code Rack::Utils.status_code(code_or_sym)
|
17
28
|
rescue ArgumentError
|
18
29
|
nil
|
19
30
|
end
|
20
31
|
when /\A\d{3}\z/
|
21
|
-
|
32
|
+
build_status_from_symbol_or_code(code_or_sym.to_i)
|
22
33
|
else
|
23
|
-
raise ArgumentError, "Invalid argument: #{
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
Status = Data.define(:code, :reason_phrase, :symbol, :const_name) do
|
28
|
-
def initialize(code:)
|
29
|
-
reason_phrase = Rack::Utils::HTTP_STATUS_CODES[code]
|
30
|
-
raise ArgumentError, "Invalid status code: #{code}" unless reason_phrase
|
31
|
-
|
32
|
-
symbol = STATUS_CODE_TO_SYMBOL[code]
|
33
|
-
const_name = Inflector.camelize(symbol.to_s)
|
34
|
-
super(code:, reason_phrase:, symbol:, const_name:)
|
34
|
+
raise ArgumentError, "Invalid argument: #{code_or_sym.inspect}"
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/lib/restful_error.rb
CHANGED
@@ -3,43 +3,62 @@
|
|
3
3
|
require "rack/utils"
|
4
4
|
require "restful_error/railtie" if defined? ActionController
|
5
5
|
require "restful_error/status"
|
6
|
-
|
7
|
-
I18n.load_path += Dir["#{File.expand_path("../config/locales")}/*.yml"] if defined? I18n
|
6
|
+
require "restful_error/version"
|
8
7
|
|
9
8
|
module RestfulError
|
10
|
-
class BaseError < StandardError; end
|
11
|
-
|
12
9
|
module Helper
|
13
10
|
def restful
|
14
|
-
|
11
|
+
@restful ||= begin
|
12
|
+
raise NotImplementedError, "http_status must be implemented by including class" unless respond_to?(:http_status)
|
13
|
+
RestfulError.build_status_from_symbol_or_code(http_status)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
def response_message
|
17
|
+
return @response_message unless @response_message.nil?
|
18
|
+
@response_message = RestfulError.localized_phrase(self.class.name, restful)
|
19
|
+
end
|
20
|
+
end
|
15
21
|
|
16
|
-
|
22
|
+
class BaseError < StandardError
|
23
|
+
include RestfulError::Helper
|
24
|
+
def initialize(message = nil)
|
25
|
+
@response_message = message
|
26
|
+
super
|
17
27
|
end
|
18
28
|
end
|
19
29
|
|
20
30
|
@cache = {}
|
21
31
|
class << self
|
22
32
|
def [](code_like)
|
23
|
-
|
24
|
-
@cache[code] ||= build_error_class_for(
|
33
|
+
status = RestfulError.build_status_from_symbol_or_code(code_like)
|
34
|
+
@cache[status.code] ||= build_error_class_for(status)
|
25
35
|
end
|
26
36
|
|
27
37
|
def const_missing(const_name)
|
28
|
-
|
29
|
-
return super unless
|
38
|
+
status = RestfulError.build_status_from_const(const_name)
|
39
|
+
return super unless status
|
40
|
+
|
41
|
+
@cache[status.code] ||= build_error_class_for(status)
|
42
|
+
end
|
30
43
|
|
31
|
-
|
44
|
+
def init_i18n
|
45
|
+
return if @init_i18n
|
46
|
+
I18n.load_path += Dir["#{File.expand_path("./config/locales")}/*.yml"]
|
47
|
+
@init_i18n = true
|
48
|
+
end
|
49
|
+
def localized_phrase(class_name, status)
|
50
|
+
return false unless defined?(I18n)
|
51
|
+
init_i18n
|
52
|
+
class_key = RestfulError::Inflector.underscore(class_name)
|
53
|
+
I18n.t class_key, default: [status.symbol, false], scope: :restful_error
|
32
54
|
end
|
33
55
|
|
34
56
|
private
|
35
57
|
|
36
|
-
def build_error_class_for(
|
37
|
-
status = Status.new(code)
|
38
|
-
message = defined?(I18n) ? I18n.t(status.symbol, default: status.reason_phrase, scope: :restful_error) : status.reason_phrase
|
58
|
+
def build_error_class_for(status)
|
39
59
|
klass = Class.new(BaseError) do
|
40
60
|
define_method(:http_status) { status.code }
|
41
61
|
define_method(:restful) { status }
|
42
|
-
define_method(:message) { message }
|
43
62
|
end
|
44
63
|
const_set(status.const_name, klass)
|
45
64
|
if defined? ActionDispatch::ExceptionWrapper
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_error
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kuboon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -38,16 +38,18 @@ executables: []
|
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|
40
40
|
files:
|
41
|
+
- LICENSE.txt
|
42
|
+
- README.md
|
43
|
+
- app/views/restful_error/show.html.erb
|
44
|
+
- app/views/restful_error/show.json.erb
|
45
|
+
- app/views/restful_error/show.xml.erb
|
46
|
+
- config/locales/en.restful_error.yml
|
47
|
+
- config/locales/ja.restful_error.yml
|
41
48
|
- lib/restful_error.rb
|
42
|
-
- lib/restful_error/engine.rb
|
43
49
|
- lib/restful_error/inflector.rb
|
44
50
|
- lib/restful_error/railtie.rb
|
45
51
|
- lib/restful_error/status.rb
|
46
52
|
- lib/restful_error/version.rb
|
47
|
-
- spec/rack_spec.rb
|
48
|
-
- spec/railtie_spec.rb
|
49
|
-
- spec/restful_error_spec.rb
|
50
|
-
- spec/spec_helper.rb
|
51
53
|
homepage: https://github.com/kuboon/restful_error
|
52
54
|
licenses:
|
53
55
|
- MIT
|
data/lib/restful_error/engine.rb
DELETED
data/spec/rack_spec.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'action_controller'
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe 'RestfulError' do
|
5
|
-
describe RestfulError::ExceptionsController do
|
6
|
-
include Rack::Test::Methods
|
7
|
-
def app
|
8
|
-
RestfulError::ExceptionsController.action(:show)
|
9
|
-
end
|
10
|
-
describe '404' do
|
11
|
-
before do
|
12
|
-
env "action_dispatch.exception", RestfulError[404].new
|
13
|
-
end
|
14
|
-
it do
|
15
|
-
get '/404'
|
16
|
-
expect(last_response.status).to eq 404
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/spec/railtie_spec.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "action_controller"
|
4
|
-
require "spec_helper"
|
5
|
-
|
6
|
-
RSpec.describe "RestfulError.exceptions_app" do
|
7
|
-
let(:app) { RestfulError.exceptions_app }
|
8
|
-
let(:env) { {} }
|
9
|
-
let(:request) { Rack::MockRequest.new(app) }
|
10
|
-
|
11
|
-
it "renders 404" do
|
12
|
-
env["action_dispatch.exception"] = ActionController::RoutingError.new("Not Found")
|
13
|
-
env["PATH_INFO"] = "/404"
|
14
|
-
response = request.get("/404", env)
|
15
|
-
expect(response.status).to eq 404
|
16
|
-
expect(response.body).to include "Not Found"
|
17
|
-
end
|
18
|
-
end
|
data/spec/restful_error_spec.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "spec_helper"
|
4
|
-
|
5
|
-
describe RestfulError do
|
6
|
-
describe "RestfullError[404]" do
|
7
|
-
subject { described_class[404].new }
|
8
|
-
|
9
|
-
it do
|
10
|
-
expect(subject.http_status).to eq 404
|
11
|
-
expect(subject.restful.reason_phrase).to eq "Not Found"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "RestfullError[:bad_request]" do
|
16
|
-
subject { described_class[:bad_request].new }
|
17
|
-
|
18
|
-
it do
|
19
|
-
expect(subject.http_status).to eq 400
|
20
|
-
expect(subject.restful.reason_phrase).to eq "Bad Request"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe described_class::Forbidden do
|
25
|
-
subject { described_class.new }
|
26
|
-
|
27
|
-
it do
|
28
|
-
expect(subject.http_status).to eq 403
|
29
|
-
expect(subject.restful.reason_phrase).to eq "Forbidden"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "custom class" do
|
34
|
-
subject { klass.new }
|
35
|
-
|
36
|
-
let(:klass) do
|
37
|
-
Class.new(StandardError) do
|
38
|
-
include RestfulError::Helper
|
39
|
-
def http_status = 404
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
it do
|
44
|
-
expect(subject.restful.symbol).to eq :not_found
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|