Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 255 lines (236 sloc) 11.806 kb
7df97d7 @jferris Added a test for the installation process
jferris authored
1 Feature: Install the Gem in a Rails application
2
3 Background:
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
4 Given I have built and installed the "airbrake" gem
7df97d7 @jferris Added a test for the installation process
jferris authored
5
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
6 Scenario: Use the gem without vendoring the gem in a Rails application
7df97d7 @jferris Added a test for the installation process
jferris authored
7 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
8 And I configure the Airbrake shim
9 And I configure my application to require the "airbrake" gem
10 And I run the airbrake generator with "-k myapikey"
641d2ca @jferris Got the generator running and a request dispatched to the test endpoint
jferris authored
11 Then the command should have run successfully
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
12 And I should receive a Airbrake notification
4f106ff @jferris Fixed reporting of Rails version
jferris authored
13 And I should see the Rails version
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
14
ad3d087 @jferris Changed rake tasks to be included instead of copied
jferris authored
15 Scenario: vendor the gem and uninstall
16 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
17 And I configure the Airbrake shim
18 And I configure my application to require the "airbrake" gem
19 And I unpack the "airbrake" gem
20 And I run the airbrake generator with "-k myapikey"
641d2ca @jferris Got the generator running and a request dispatched to the test endpoint
jferris authored
21 Then the command should have run successfully
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
22 When I uninstall the "airbrake" gem
f488c09 @jferris Support bundler
jferris authored
23 And I install cached gems
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
24 And I run "rake airbrake:test"
25 Then I should see "** [Airbrake] Success: Net::HTTPOK"
26 And I should receive two Airbrake notifications
ad3d087 @jferris Changed rake tasks to be included instead of copied
jferris authored
27
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
28 Scenario: Configure the notifier by hand
29 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
30 And I configure the Airbrake shim
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
31 And I configure the notifier to use "myapikey" as an API key
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
32 And I configure my application to require the "airbrake" gem
33 And I run the airbrake generator with ""
34 Then I should receive a Airbrake notification
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
35
15358af Initializer configuration overrides Railtie configuration if set
Daniel Barron authored
36 Scenario: Configuration within initializer isn't overridden by Railtie
37 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
38 And I configure the Airbrake shim
39 And I configure my application to require the "airbrake" gem
40 And I run the airbrake generator with "-k myapikey"
15358af Initializer configuration overrides Railtie configuration if set
Daniel Barron authored
41 Then the command should have run successfully
42 When I configure the notifier to use the following configuration lines:
43 """
44 config.api_key = "myapikey"
45 config.project_root = "argle/bargle"
46 """
47 And I define a response for "TestController#index":
48 """
49 session[:value] = "test"
50 raise RuntimeError, "some message"
51 """
52 And I route "/test/index" to "test#index"
53 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
54 Then I should receive the following Airbrake notification:
15358af Initializer configuration overrides Railtie configuration if set
Daniel Barron authored
55 | project-root | argle/bargle |
56
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
57 Scenario: Try to install without an api key
58 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
59 And I configure my application to require the "airbrake" gem
60 And I run the airbrake generator with ""
61 Then I should see "Must pass --api-key or --heroku or create config/initializers/airbrake.rb"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
62
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
63 Scenario: Configure and deploy using only installed gem
2be23d7 @jferris Fixed capistrano recipes
jferris authored
64 When I generate a new Rails application
65 And I run "capify ."
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
66 And I configure the Airbrake shim
67 And I configure my application to require the "airbrake" gem
68 And I run the airbrake generator with "-k myapikey"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
69 And I run "cap -T"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
70 Then I should see "deploy:notify_airbrake"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
71
72 Scenario: Configure and deploy using only vendored gem
73 When I generate a new Rails application
74 And I run "capify ."
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
75 And I configure the Airbrake shim
76 And I configure my application to require the "airbrake" gem
77 And I unpack the "airbrake" gem
78 And I run the airbrake generator with "-k myapikey"
79 And I uninstall the "airbrake" gem
e6f87a5 @jferris Added a capistrano hook for Rails 3
jferris authored
80 And I install cached gems
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
81 And I run "cap -T"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
82 Then I should see "deploy:notify_airbrake"
c1da35c LH-591 Notifier generator checks the presence of the hoptoad_notifier pl...
damselem authored
83
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
84 Scenario: Try to install when the airbrake plugin still exists
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
85 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
86 And I install the "airbrake" plugin
87 And I configure the Airbrake shim
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
88 And I configure the notifier to use "myapikey" as an API key
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
89 And I configure my application to require the "airbrake" gem
90 And I run the airbrake generator with ""
91 Then I should see "You must first remove the airbrake plugin. Please run: script/plugin remove airbrake"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
92
93 Scenario: Rescue an exception in a controller
94 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
95 And I configure the Airbrake shim
96 And I configure my application to require the "airbrake" gem
97 And I run the airbrake generator with "-k myapikey"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
98 And I define a response for "TestController#index":
99 """
100 session[:value] = "test"
101 raise RuntimeError, "some message"
102 """
1bab4e3 @jferris Extract request info from rack env
jferris authored
103 And I route "/test/index" to "test#index"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
104 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
105 Then I should receive the following Airbrake notification:
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
106 | component | test |
107 | action | index |
108 | error message | RuntimeError: some message |
109 | error class | RuntimeError |
110 | session | value: test |
111 | parameters | param: value |
112 | url | http://example.com:123/test/index?param=value |
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
113
114 Scenario: The gem should not be considered a framework gem
115 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
116 And I configure the Airbrake shim
117 And I configure my application to require the "airbrake" gem
118 And I run the airbrake generator with "-k myapikey"
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
119 And I run "rake gems"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
120 Then I should see that "airbrake" is not considered a framework gem
a010408 don't append capistrano details to config.deploy.rb when target app uses...
Dan Lawless authored
121
122 Scenario: The app uses Vlad instead of Capistrano
123 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
124 And I configure the Airbrake shim
125 And I configure my application to require the "airbrake" gem
a010408 don't append capistrano details to config.deploy.rb when target app uses...
Dan Lawless authored
126 And I run "touch config/deploy.rb"
127 And I run "rm Capfile"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
128 And I run the airbrake generator with "-k myapikey"
6ed1a80 @jferris Fixed Rails 3 generator not to append cap hooks for vlad deploys
jferris authored
129 Then "config/deploy.rb" should not contain "capistrano"
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
130
131 Scenario: Support the Heroku addon in the generator
132 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
133 And I configure the Airbrake shim
211065e @jasonm Add --heroku flag to generator to support ENV['HOPTOAD_API_KEY']
jasonm authored
134 And I configure the Heroku rake shim
95e7b89 @jyurek Getting green cucumber stories
jyurek authored
135 And I configure the Heroku gem shim with "myapikey"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
136 And I configure my application to require the "airbrake" gem
137 And I run the airbrake generator with "--heroku"
211065e @jasonm Add --heroku flag to generator to support ENV['HOPTOAD_API_KEY']
jasonm authored
138 Then the command should have run successfully
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
139 And I should receive a Airbrake notification
211065e @jasonm Add --heroku flag to generator to support ENV['HOPTOAD_API_KEY']
jasonm authored
140 And I should see the Rails version
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
141 And my Airbrake configuration should contain the following line:
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
142 """
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
143 config.api_key = ENV['AIRBRAKE_API_KEY']
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
144 """
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
145
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
146 Scenario: Support the --app option for the Heroku addon in the generator
147 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
148 And I configure the Airbrake shim
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
149 And I configure the Heroku rake shim
150 And I configure the Heroku gem shim with "myapikey" and multiple app support
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
151 And I configure my application to require the "airbrake" gem
152 And I run the airbrake generator with "--heroku -a myapp"
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
153 Then the command should have run successfully
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
154 And I should receive a Airbrake notification
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
155 And I should see the Rails version
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
156 And my Airbrake configuration should contain the following line:
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
157 """
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
158 config.api_key = ENV['AIRBRAKE_API_KEY']
c10b012 @gabebw Pass the --app option through to the heroku CLI.
gabebw authored
159 """
160
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
161 Scenario: Filtering parameters in a controller
162 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
163 And I configure the Airbrake shim
164 And I configure my application to require the "airbrake" gem
165 And I run the airbrake generator with "-k myapikey"
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
166 When I configure the notifier to use the following configuration lines:
167 """
168 config.api_key = "myapikey"
169 config.params_filters << "credit_card_number"
170 """
171 And I define a response for "TestController#index":
172 """
173 params[:credit_card_number] = "red23"
174 raise RuntimeError, "some message"
175 """
176 And I route "/test/index" to "test#index"
177 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
178 Then I should receive the following Airbrake notification:
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
179 | component | test |
180 | action | index |
181 | error message | RuntimeError: some message |
182 | error class | RuntimeError |
183 | parameters | credit_card_number: [FILTERED] |
184 | url | http://example.com:123/test/index?param=value |
185
186 Scenario: Filtering session in a controller
187 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
188 And I configure the Airbrake shim
189 And I configure my application to require the "airbrake" gem
190 And I run the airbrake generator with "-k myapikey"
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
191 When I configure the notifier to use the following configuration lines:
192 """
193 config.api_key = "myapikey"
194 config.params_filters << "secret"
195 """
196 And I define a response for "TestController#index":
197 """
198 session["secret"] = "blue42"
199 raise RuntimeError, "some message"
200 """
201 And I route "/test/index" to "test#index"
202 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
203 Then I should receive the following Airbrake notification:
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
204 | component | test |
205 | action | index |
206 | error message | RuntimeError: some message |
207 | error class | RuntimeError |
208 | session | secret: [FILTERED] |
209 | url | http://example.com:123/test/index?param=value |
210
211 Scenario: Filtering session and params based on Rails parameter filters
212 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
213 And I configure the Airbrake shim
214 And I configure my application to require the "airbrake" gem
215 And I run the airbrake generator with "-k myapikey"
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
216 And I configure the application to filter parameter "secret"
217 And I define a response for "TestController#index":
218 """
219 params["secret"] = "red23"
220 session["secret"] = "blue42"
221 raise RuntimeError, "some message"
222 """
223 And I route "/test/index" to "test#index"
224 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
225 Then I should receive the following Airbrake notification:
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to session ...
jasonm authored
226 | component | test |
227 | action | index |
228 | error message | RuntimeError: some message |
229 | error class | RuntimeError |
230 | params | secret: [FILTERED] |
231 | session | secret: [FILTERED] |
232 | url | http://example.com:123/test/index?param=value |
652321d @kylecrum added a scenario for using the notify_hoptoad method within a controller
kylecrum authored
233
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
234 Scenario: Notify airbrake within the controller
652321d @kylecrum added a scenario for using the notify_hoptoad method within a controller
kylecrum authored
235 When I generate a new Rails application
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
236 And I configure the Airbrake shim
237 And I configure my application to require the "airbrake" gem
238 And I run the airbrake generator with "-k myapikey"
652321d @kylecrum added a scenario for using the notify_hoptoad method within a controller
kylecrum authored
239 And I define a response for "TestController#index":
240 """
241 session[:value] = "test"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
242 notify_airbrake(RuntimeError.new("some message"))
652321d @kylecrum added a scenario for using the notify_hoptoad method within a controller
kylecrum authored
243 render :nothing => true
244 """
245 And I route "/test/index" to "test#index"
246 And I perform a request to "http://example.com:123/test/index?param=value"
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
247 Then I should receive the following Airbrake notification:
652321d @kylecrum added a scenario for using the notify_hoptoad method within a controller
kylecrum authored
248 | component | test |
249 | action | index |
250 | error message | RuntimeError: some message |
251 | error class | RuntimeError |
252 | session | value: test |
253 | parameters | param: value |
254 | url | http://example.com:123/test/index?param=value |
Something went wrong with that request. Please try again.