lotus-controller 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +127 -0
- data/{LICENSE.txt → LICENSE.md} +0 -0
- data/README.md +259 -15
- data/lib/lotus/action.rb +20 -0
- data/lib/lotus/action/callbacks.rb +20 -2
- data/lib/lotus/action/configurable.rb +48 -0
- data/lib/lotus/action/cookie_jar.rb +29 -5
- data/lib/lotus/action/exposable.rb +12 -5
- data/lib/lotus/action/mime.rb +215 -32
- data/lib/lotus/action/params.rb +21 -4
- data/lib/lotus/action/rack.rb +81 -0
- data/lib/lotus/action/redirect.rb +6 -1
- data/lib/lotus/action/session.rb +1 -0
- data/lib/lotus/action/throwable.rb +37 -36
- data/lib/lotus/controller.rb +216 -17
- data/lib/lotus/controller/configuration.rb +510 -0
- data/lib/lotus/controller/dsl.rb +6 -4
- data/lib/lotus/controller/version.rb +1 -1
- data/lib/lotus/http/status.rb +5 -62
- data/lib/rack-patch.rb +4 -2
- data/lotus-controller.gemspec +3 -3
- metadata +26 -56
- data/.gitignore +0 -10
- data/.travis.yml +0 -5
- data/.yardopts +0 -4
- data/Gemfile +0 -15
- data/Rakefile +0 -17
- data/test/action/callbacks_test.rb +0 -99
- data/test/action/params_test.rb +0 -29
- data/test/action_test.rb +0 -31
- data/test/controller_test.rb +0 -24
- data/test/cookies_test.rb +0 -36
- data/test/fixtures.rb +0 -501
- data/test/integration/mime_type_test.rb +0 -175
- data/test/integration/routing_test.rb +0 -141
- data/test/integration/sessions_test.rb +0 -63
- data/test/redirect_test.rb +0 -20
- data/test/session_test.rb +0 -19
- data/test/test_helper.rb +0 -24
- data/test/throw_test.rb +0 -93
- data/test/version_test.rb +0 -7
data/lib/lotus/controller/dsl.rb
CHANGED
@@ -5,9 +5,7 @@ module Lotus
|
|
5
5
|
# @since 0.1.0
|
6
6
|
module Dsl
|
7
7
|
def self.included(base)
|
8
|
-
base.
|
9
|
-
extend ClassMethods
|
10
|
-
end
|
8
|
+
base.extend ClassMethods
|
11
9
|
end
|
12
10
|
|
13
11
|
module ClassMethods
|
@@ -22,6 +20,8 @@ module Lotus
|
|
22
20
|
#
|
23
21
|
# @since 0.1.0
|
24
22
|
#
|
23
|
+
# @see Lotus::Controller::Configuration#action_module
|
24
|
+
#
|
25
25
|
# @example
|
26
26
|
# require 'lotus/controller'
|
27
27
|
#
|
@@ -41,10 +41,12 @@ module Lotus
|
|
41
41
|
# end
|
42
42
|
# end
|
43
43
|
def action(name, &blk)
|
44
|
+
config = configuration.duplicate
|
44
45
|
const_set(name, Class.new)
|
45
46
|
|
46
47
|
const_get(name).tap do |klass|
|
47
|
-
klass.class_eval { include
|
48
|
+
klass.class_eval { include config.action_module }
|
49
|
+
klass.configuration = config
|
48
50
|
klass.class_eval(&blk)
|
49
51
|
end
|
50
52
|
end
|
data/lib/lotus/http/status.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rack/utils'
|
2
|
+
|
1
3
|
module Lotus
|
2
4
|
module Http
|
3
5
|
# An HTTP status
|
@@ -9,78 +11,19 @@ module Lotus
|
|
9
11
|
#
|
10
12
|
# @since 0.1.0
|
11
13
|
# @api private
|
12
|
-
ALL = {
|
13
|
-
100 => 'Continue',
|
14
|
-
101 => 'Switching Protocols',
|
15
|
-
102 => 'Processing (WebDAV) (RFC 2518)',
|
14
|
+
ALL = ::Rack::Utils::HTTP_STATUS_CODES.dup.merge({
|
16
15
|
103 => 'Checkpoint',
|
17
16
|
122 => 'Request-URI too long',
|
18
|
-
|
19
|
-
201 => 'Created',
|
20
|
-
202 => 'Accepted',
|
21
|
-
203 => 'Non-Authoritative Information',
|
22
|
-
204 => 'No Content',
|
23
|
-
205 => 'Reset Content',
|
24
|
-
206 => 'Partial Content',
|
25
|
-
207 => 'Multi-Status (WebDAV) (RFC 4918)',
|
26
|
-
208 => 'Already Reported (WebDAV) (RFC 5842)',
|
27
|
-
226 => 'IM Used (RFC 3229)',
|
28
|
-
300 => 'Multiple Choices',
|
29
|
-
301 => 'Moved Permanently',
|
30
|
-
302 => 'Found',
|
31
|
-
303 => 'See Other',
|
32
|
-
304 => 'Not Modified',
|
33
|
-
305 => 'Use Proxy',
|
34
|
-
306 => 'Switch Proxy',
|
35
|
-
307 => 'Temporary Redirect',
|
36
|
-
308 => 'Resume Incomplete',
|
37
|
-
400 => 'Bad Request',
|
38
|
-
401 => 'Unauthorized',
|
39
|
-
402 => 'Payment Required',
|
40
|
-
403 => 'Forbidden',
|
41
|
-
404 => 'Not Found',
|
42
|
-
405 => 'Method Not Allowed',
|
43
|
-
406 => 'Not Acceptable',
|
44
|
-
407 => 'Proxy Authentication Required',
|
45
|
-
408 => 'Request Timeout',
|
46
|
-
409 => 'Conflict',
|
47
|
-
410 => 'Gone',
|
48
|
-
411 => 'Length Required',
|
49
|
-
412 => 'Precondition Failed',
|
50
|
-
413 => 'Request Entity Too Large',
|
51
|
-
414 => 'Request-URI Too Long',
|
52
|
-
415 => 'Unsupported Media Type',
|
53
|
-
416 => 'Requested Range Not Satisfiable',
|
54
|
-
417 => 'Expectation Failed',
|
55
|
-
418 => 'I\'m a teapot (RFC 2324)',
|
17
|
+
418 => 'I\'m a teapot',
|
56
18
|
420 => 'Enhance Your Calm',
|
57
|
-
422 => 'Unprocessable Entity (WebDAV) (RFC 4918)',
|
58
|
-
423 => 'Locked (WebDAV) (RFC 4918)',
|
59
|
-
424 => 'Failed Dependency (WebDAV) (RFC 4918)',
|
60
|
-
426 => 'Upgrade Required (RFC 2817)',
|
61
|
-
428 => 'Precondition Required',
|
62
|
-
429 => 'Too Many Requests',
|
63
|
-
431 => 'Request Header Fields Too Large',
|
64
19
|
444 => 'No Response',
|
65
20
|
449 => 'Retry With',
|
66
21
|
450 => 'Blocked by Windows Parental Controls',
|
67
22
|
451 => 'Wrong Exchange server',
|
68
23
|
499 => 'Client Closed Request',
|
69
|
-
500 => 'Internal Server Error',
|
70
|
-
501 => 'Not Implemented',
|
71
|
-
502 => 'Bad Gateway',
|
72
|
-
503 => 'Service Unavailable',
|
73
|
-
504 => 'Gateway Timeout',
|
74
|
-
505 => 'HTTP Version Not Supported',
|
75
|
-
506 => 'Variant Also Negotiates (RFC 2295)',
|
76
|
-
507 => 'Insufficient Storage (WebDAV) (RFC 4918)',
|
77
|
-
508 => 'Loop Detected (WebDAV) (RFC 5842)',
|
78
|
-
509 => 'Bandwidth Limit Exceeded (Apache bw\/limited extension)',
|
79
|
-
510 => 'Not Extended (RFC 2774)',
|
80
|
-
511 => 'Network Authentication Required',
|
81
24
|
598 => 'Network read timeout error',
|
82
25
|
599 => 'Network connect timeout error'
|
83
|
-
}.freeze
|
26
|
+
}).freeze
|
84
27
|
|
85
28
|
# Return a status for the given code
|
86
29
|
#
|
data/lib/rack-patch.rb
CHANGED
@@ -8,13 +8,15 @@ if Rack.release <= '1.5'
|
|
8
8
|
def self.best_q_match(q_value_header, available_mimes)
|
9
9
|
values = q_values(q_value_header)
|
10
10
|
|
11
|
-
values.map do |req_mime, quality|
|
11
|
+
value = values.map do |req_mime, quality|
|
12
12
|
match = available_mimes.find { |am| Rack::Mime.match?(am, req_mime) }
|
13
13
|
next unless match
|
14
14
|
[match, quality]
|
15
15
|
end.compact.sort_by do |match, quality|
|
16
16
|
(match.split('/', 2).count('*') * -10) + quality
|
17
|
-
end.last
|
17
|
+
end.last
|
18
|
+
|
19
|
+
value.first if value
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
data/lotus-controller.gemspec
CHANGED
@@ -13,15 +13,15 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'http://lotusrb.org'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files -- lib/* CHANGELOG.md LICENSE.md README.md lotus-controller.gemspec`.split($/)
|
17
17
|
spec.executables = []
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'rack', '~> 1.5'
|
22
|
-
spec.add_dependency 'lotus-utils', '~> 0.
|
22
|
+
spec.add_dependency 'lotus-utils', '~> 0.2'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
25
25
|
spec.add_development_dependency 'minitest', '~> 5'
|
26
26
|
spec.add_development_dependency 'rack-test', '~> 0.6'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10'
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus-controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: lotus-utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack-test
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.6'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.6'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '10'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '10'
|
97
97
|
description: Controller layer for Lotus
|
@@ -101,17 +101,14 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
-
|
105
|
-
-
|
106
|
-
- ".yardopts"
|
107
|
-
- Gemfile
|
108
|
-
- LICENSE.txt
|
104
|
+
- CHANGELOG.md
|
105
|
+
- LICENSE.md
|
109
106
|
- README.md
|
110
|
-
- Rakefile
|
111
107
|
- lib/lotus-controller.rb
|
112
108
|
- lib/lotus/action.rb
|
113
109
|
- lib/lotus/action/callable.rb
|
114
110
|
- lib/lotus/action/callbacks.rb
|
111
|
+
- lib/lotus/action/configurable.rb
|
115
112
|
- lib/lotus/action/cookie_jar.rb
|
116
113
|
- lib/lotus/action/cookies.rb
|
117
114
|
- lib/lotus/action/exposable.rb
|
@@ -122,25 +119,12 @@ files:
|
|
122
119
|
- lib/lotus/action/session.rb
|
123
120
|
- lib/lotus/action/throwable.rb
|
124
121
|
- lib/lotus/controller.rb
|
122
|
+
- lib/lotus/controller/configuration.rb
|
125
123
|
- lib/lotus/controller/dsl.rb
|
126
124
|
- lib/lotus/controller/version.rb
|
127
125
|
- lib/lotus/http/status.rb
|
128
126
|
- lib/rack-patch.rb
|
129
127
|
- lotus-controller.gemspec
|
130
|
-
- test/action/callbacks_test.rb
|
131
|
-
- test/action/params_test.rb
|
132
|
-
- test/action_test.rb
|
133
|
-
- test/controller_test.rb
|
134
|
-
- test/cookies_test.rb
|
135
|
-
- test/fixtures.rb
|
136
|
-
- test/integration/mime_type_test.rb
|
137
|
-
- test/integration/routing_test.rb
|
138
|
-
- test/integration/sessions_test.rb
|
139
|
-
- test/redirect_test.rb
|
140
|
-
- test/session_test.rb
|
141
|
-
- test/test_helper.rb
|
142
|
-
- test/throw_test.rb
|
143
|
-
- test/version_test.rb
|
144
128
|
homepage: http://lotusrb.org
|
145
129
|
licenses:
|
146
130
|
- MIT
|
@@ -151,33 +135,19 @@ require_paths:
|
|
151
135
|
- lib
|
152
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
153
137
|
requirements:
|
154
|
-
- -
|
138
|
+
- - '>='
|
155
139
|
- !ruby/object:Gem::Version
|
156
140
|
version: '0'
|
157
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
142
|
requirements:
|
159
|
-
- -
|
143
|
+
- - '>='
|
160
144
|
- !ruby/object:Gem::Version
|
161
145
|
version: '0'
|
162
146
|
requirements: []
|
163
147
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.0.14
|
165
149
|
signing_key:
|
166
150
|
specification_version: 4
|
167
151
|
summary: Controller layer for Lotus, compatible with Rack
|
168
|
-
test_files:
|
169
|
-
- test/action/callbacks_test.rb
|
170
|
-
- test/action/params_test.rb
|
171
|
-
- test/action_test.rb
|
172
|
-
- test/controller_test.rb
|
173
|
-
- test/cookies_test.rb
|
174
|
-
- test/fixtures.rb
|
175
|
-
- test/integration/mime_type_test.rb
|
176
|
-
- test/integration/routing_test.rb
|
177
|
-
- test/integration/sessions_test.rb
|
178
|
-
- test/redirect_test.rb
|
179
|
-
- test/session_test.rb
|
180
|
-
- test/test_helper.rb
|
181
|
-
- test/throw_test.rb
|
182
|
-
- test/version_test.rb
|
152
|
+
test_files: []
|
183
153
|
has_rdoc:
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/.yardopts
DELETED
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
if !ENV['TRAVIS']
|
6
|
-
gem 'debugger', require: false
|
7
|
-
gem 'yard', require: false
|
8
|
-
gem 'lotus-utils', require: false, path: '../lotus-utils'
|
9
|
-
gem 'lotus-router', require: false, path: '../lotus-router'
|
10
|
-
else
|
11
|
-
gem 'lotus-router', require: false
|
12
|
-
end
|
13
|
-
|
14
|
-
gem 'simplecov', require: false
|
15
|
-
gem 'coveralls', require: false
|
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
|
5
|
-
Rake::TestTask.new do |t|
|
6
|
-
t.pattern = 'test/**/*_test.rb'
|
7
|
-
t.libs.push 'test'
|
8
|
-
end
|
9
|
-
|
10
|
-
namespace :test do
|
11
|
-
task :coverage do
|
12
|
-
ENV['COVERAGE'] = 'true'
|
13
|
-
Rake::Task['test'].invoke
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
task default: :test
|
@@ -1,99 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe Lotus::Action do
|
4
|
-
describe '#before' do
|
5
|
-
it 'invokes the method(s) from the given symbol(s) before the action is run' do
|
6
|
-
action = BeforeMethodAction.new
|
7
|
-
action.call({})
|
8
|
-
|
9
|
-
action.article.must_equal 'Bonjour!'.reverse
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'invokes the given block before the action is run' do
|
13
|
-
action = BeforeBlockAction.new
|
14
|
-
action.call({})
|
15
|
-
|
16
|
-
action.article.must_equal 'Good morning!'.reverse
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'inherits callbacks from superclass' do
|
20
|
-
action = SubclassBeforeMethodAction.new
|
21
|
-
action.call({})
|
22
|
-
|
23
|
-
action.article.must_equal 'Bonjour!'.reverse.upcase
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'can optionally have params in method signature' do
|
27
|
-
action = ParamsBeforeMethodAction.new
|
28
|
-
action.call(params = {bang: '!'})
|
29
|
-
|
30
|
-
action.article.must_equal 'Bonjour!!'.reverse
|
31
|
-
action.exposed_params.must_equal(params)
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'yields params when the callback is a block' do
|
35
|
-
action = YieldBeforeBlockAction.new
|
36
|
-
response = action.call(params = { twentythree: '23' })
|
37
|
-
|
38
|
-
response[0].must_equal 200
|
39
|
-
action.yielded_params.must_equal params
|
40
|
-
end
|
41
|
-
|
42
|
-
describe 'on error' do
|
43
|
-
it 'stops the callbacks execution and returns an HTTP 500 status' do
|
44
|
-
action = ErrorBeforeMethodAction.new
|
45
|
-
response = action.call({})
|
46
|
-
|
47
|
-
response[0].must_equal 500
|
48
|
-
action.article.must_be_nil
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#after' do
|
54
|
-
it 'invokes the method(s) from the given symbol(s) after the action is run' do
|
55
|
-
action = AfterMethodAction.new
|
56
|
-
action.call({})
|
57
|
-
|
58
|
-
action.egg.must_equal 'gE!g'
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'invokes the given block after the action is run' do
|
62
|
-
action = AfterBlockAction.new
|
63
|
-
action.call({})
|
64
|
-
|
65
|
-
action.egg.must_equal 'Coque'.reverse
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'inherits callbacks from superclass' do
|
69
|
-
action = SubclassAfterMethodAction.new
|
70
|
-
action.call({})
|
71
|
-
|
72
|
-
action.egg.must_equal 'gE!g'.upcase
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'can optionally have params in method signature' do
|
76
|
-
action = ParamsAfterMethodAction.new
|
77
|
-
action.call(question: '?')
|
78
|
-
|
79
|
-
action.egg.must_equal 'gE!g?'
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'yields params when the callback is a block' do
|
83
|
-
action = YieldAfterBlockAction.new
|
84
|
-
action.call(params = { fortytwo: '42' })
|
85
|
-
|
86
|
-
action.meaning_of_life_params.must_equal params
|
87
|
-
end
|
88
|
-
|
89
|
-
describe 'on error' do
|
90
|
-
it 'stops the callbacks execution and returns an HTTP 500 status' do
|
91
|
-
action = ErrorAfterMethodAction.new
|
92
|
-
response = action.call({})
|
93
|
-
|
94
|
-
response[0].must_equal 500
|
95
|
-
action.egg.must_be_nil
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|