exceptionally 1.4.0 → 1.4.1
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/lib/exceptionally/handler.rb +4 -1
- data/lib/exceptionally/version.rb +1 -1
- data/spec/dummy/log/test.log +6070 -0
- data/spec/exceptionally/handler_spec.rb +17 -5
- metadata +2 -2
|
@@ -9,6 +9,18 @@ describe ActionController, :type => :controller do
|
|
|
9
9
|
|
|
10
10
|
before do
|
|
11
11
|
routes.draw { get 'index' => "anonymous#index" }
|
|
12
|
+
Rails.application.config.filter_parameters = [:password]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'filters password parameter' do
|
|
16
|
+
temp_params = nil
|
|
17
|
+
Exceptionally::Handler.before_render do |message, status, error, params|
|
|
18
|
+
temp_params = params
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
get :index, username: 'bob', password: '123456'
|
|
22
|
+
expect(temp_params['username']).to eq('bob')
|
|
23
|
+
expect(temp_params['password']).to eq('[FILTERED]')
|
|
12
24
|
end
|
|
13
25
|
|
|
14
26
|
it 'logs 5xx errors' do
|
|
@@ -33,20 +45,20 @@ describe ActionController, :type => :controller do
|
|
|
33
45
|
end
|
|
34
46
|
|
|
35
47
|
it 'calls handler before logging an error when set' do
|
|
36
|
-
|
|
48
|
+
temp_message = nil
|
|
37
49
|
Exceptionally::Handler.before_render do |message, status, error, params|
|
|
38
|
-
|
|
50
|
+
temp_message = message
|
|
39
51
|
end
|
|
40
52
|
|
|
41
53
|
get :index
|
|
42
|
-
expect(
|
|
54
|
+
expect(temp_message).to eq('Internal Server Error')
|
|
43
55
|
end
|
|
44
56
|
|
|
45
57
|
it 'does not call handler before logging an error when none is proved' do
|
|
46
|
-
|
|
58
|
+
temp_message = nil
|
|
47
59
|
|
|
48
60
|
get :index
|
|
49
|
-
expect(
|
|
61
|
+
expect(temp_message).to eq(nil)
|
|
50
62
|
end
|
|
51
63
|
|
|
52
64
|
describe 'when only Raven is defined' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: exceptionally
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Neil Gupta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|