airbrake 5.0.4 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake/rack/notice_builder.rb +28 -0
- data/lib/airbrake/rack/user.rb +2 -1
- data/lib/airbrake/version.rb +1 -1
- data/spec/apps/rails/logs/32.log +214 -0
- data/spec/apps/rails/logs/40.log +452 -0
- data/spec/apps/rails/logs/41.log +457 -0
- data/spec/apps/rails/logs/42.log +980 -0
- data/spec/apps/rails/logs/50.log +465 -0
- data/spec/integration/rails/rails_spec.rb +1 -1
- data/spec/integration/shared_examples/rack_examples.rb +21 -1
- data/spec/unit/rack/user_spec.rb +19 -6
- metadata +10 -2
@@ -85,7 +85,7 @@ RSpec.shared_examples 'rack examples' do
|
|
85
85
|
|
86
86
|
context "when additional parameters present" do
|
87
87
|
before do
|
88
|
-
get '/crash', nil, 'HTTP_USER_AGENT' => 'Bot'
|
88
|
+
get '/crash', nil, 'HTTP_USER_AGENT' => 'Bot', 'HTTP_REFERER' => 'bingo.com'
|
89
89
|
end
|
90
90
|
|
91
91
|
it "features url" do
|
@@ -103,4 +103,24 @@ RSpec.shared_examples 'rack examples' do
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
106
|
+
|
107
|
+
describe "environment payload" do
|
108
|
+
before do
|
109
|
+
get '/crash', nil, 'HTTP_REFERER' => 'bingo.com'
|
110
|
+
end
|
111
|
+
|
112
|
+
it "features referer" do
|
113
|
+
wait_for_a_request_with_body(/"environment":{.*"referer":"bingo.com".*}/)
|
114
|
+
end
|
115
|
+
|
116
|
+
it "contains HTTP headers" do
|
117
|
+
wait_for_a_request_with_body(
|
118
|
+
/"environment":{.*"headers":{.*"CONTENT_LENGTH":"0".*}/
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "contains HTTP method" do
|
123
|
+
wait_for_a_request_with_body(/"environment":{.*"httpMethod":"GET".*}/)
|
124
|
+
end
|
125
|
+
end
|
106
126
|
end
|
data/spec/unit/rack/user_spec.rb
CHANGED
@@ -52,13 +52,26 @@ RSpec.describe Airbrake::Rack::User do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
context "when the current_user Rails controller method is defined" do
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
context "and it is nil" do
|
56
|
+
it "returns nil" do
|
57
|
+
controller = instance_double('DummyController')
|
58
|
+
env = env_for('/', 'action_controller.instance' => controller)
|
59
|
+
allow(controller).to receive(:current_user) { nil }
|
59
60
|
|
60
|
-
|
61
|
-
|
61
|
+
retval = described_class.extract(env)
|
62
|
+
expect(retval).to be_nil
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "and it is not nil" do
|
67
|
+
it "returns the wrapped user" do
|
68
|
+
controller = instance_double('DummyController')
|
69
|
+
env = env_for('/', 'action_controller.instance' => controller)
|
70
|
+
allow(controller).to receive(:current_user) { user }
|
71
|
+
|
72
|
+
retval = described_class.extract(env)
|
73
|
+
expect(retval).to be_a(described_class)
|
74
|
+
end
|
62
75
|
end
|
63
76
|
end
|
64
77
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|
@@ -187,7 +187,11 @@ files:
|
|
187
187
|
- spec/apps/rack/dummy_app.rb
|
188
188
|
- spec/apps/rails/dummy_app.rb
|
189
189
|
- spec/apps/rails/dummy_task.rake
|
190
|
+
- spec/apps/rails/logs/32.log
|
191
|
+
- spec/apps/rails/logs/40.log
|
192
|
+
- spec/apps/rails/logs/41.log
|
190
193
|
- spec/apps/rails/logs/42.log
|
194
|
+
- spec/apps/rails/logs/50.log
|
191
195
|
- spec/apps/sinatra/dummy_app.rb
|
192
196
|
- spec/integration/rack/rack_spec.rb
|
193
197
|
- spec/integration/rails/rails_spec.rb
|
@@ -234,7 +238,11 @@ test_files:
|
|
234
238
|
- spec/spec_helper.rb
|
235
239
|
- spec/apps/rack/dummy_app.rb
|
236
240
|
- spec/apps/sinatra/dummy_app.rb
|
241
|
+
- spec/apps/rails/logs/40.log
|
237
242
|
- spec/apps/rails/logs/42.log
|
243
|
+
- spec/apps/rails/logs/50.log
|
244
|
+
- spec/apps/rails/logs/32.log
|
245
|
+
- spec/apps/rails/logs/41.log
|
238
246
|
- spec/apps/rails/dummy_app.rb
|
239
247
|
- spec/apps/rails/dummy_task.rake
|
240
248
|
- spec/airbrake_spec.rb
|