Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 240 lines (222 sloc) 11.283 kB
7df97d7 @jferris Added a test for the installation process
jferris authored
1 Feature: Install the Gem in a Rails application
2
3 Background:
4 Given I have built and installed the "hoptoad_notifier" gem
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
8 And I configure the Hoptoad shim
9 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
10 And I run the hoptoad 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
12 And I should receive a Hoptoad 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
17 And I configure the Hoptoad shim
18 And I configure my application to require the "hoptoad_notifier" gem
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
19 And I unpack the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
20 And I run the hoptoad 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
22 When I uninstall the "hoptoad_notifier" gem
f488c09 @jferris Support bundler
jferris authored
23 And I install cached gems
f0ff91c @gabebw Don't use bundle exec in tests
gabebw authored
24 And I run "rake hoptoad:test"
9c4f29e @jasonm Fix the initializer syntax in the Rails 3 Railtie
jasonm authored
25 Then I should see "** [Hoptoad] Success: Net::HTTPOK"
641d2ca @jferris Got the generator running and a request dispatched to the test endpoint
jferris authored
26 And I should receive two Hoptoad 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
30 And I configure the Hoptoad shim
31 And I configure the notifier to use "myapikey" as an API key
32 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
33 And I run the hoptoad generator with ""
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
34 Then I should receive a Hoptoad notification
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
38 And I configure the Hoptoad shim
39 And I configure my application to require the "hoptoad_notifier" gem
40 And I run the hoptoad generator with "-k myapikey"
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"
54 Then I should receive the following Hoptoad notification:
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
59 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
60 And I run the hoptoad generator with ""
46f12ae @jasonm Reflect a copy change in rails.feature for --heroku generator flag
jasonm authored
61 Then I should see "Must pass --api-key or --heroku or create config/initializers/hoptoad.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 ."
66 And I configure the Hoptoad shim
67 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
68 And I run the hoptoad generator with "-k myapikey"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
69 And I run "cap -T"
70 Then I should see "deploy:notify_hoptoad"
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 ."
75 And I configure the Hoptoad shim
76 And I configure my application to require the "hoptoad_notifier" gem
77 And I unpack the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
78 And I run the hoptoad generator with "-k myapikey"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
79 And I uninstall the "hoptoad_notifier" 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"
82 Then I should see "deploy:notify_hoptoad"
c1da35c LH-591 Notifier generator checks the presence of the hoptoad_notifier…
damselem authored
83
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
84 Scenario: Try to install when the hoptoad_notifier plugin still exists
85 When I generate a new Rails application
86 And I install the "hoptoad_notifier" plugin
87 And I configure the Hoptoad shim
88 And I configure the notifier to use "myapikey" as an API key
89 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
90 And I run the hoptoad generator with ""
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
91 Then I should see "You must first remove the hoptoad_notifier plugin. Please run: script/plugin remove hoptoad_notifier"
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
95 And I configure the Hoptoad shim
96 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
97 And I run the hoptoad 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"
105 Then I should receive the following Hoptoad notification:
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
116 And I configure the Hoptoad shim
117 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
118 And I run the hoptoad generator with "-k myapikey"
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
119 And I run "rake gems"
120 Then I should see that "hoptoad_notifier" is not considered a framework gem
a010408 don't append capistrano details to config.deploy.rb when target app u…
Dan Lawless authored
121
122 Scenario: The app uses Vlad instead of Capistrano
123 When I generate a new Rails application
124 And I configure the Hoptoad shim
125 And I configure my application to require the "hoptoad_notifier" gem
126 And I run "touch config/deploy.rb"
127 And I run "rm Capfile"
6ed1a80 @jferris Fixed Rails 3 generator not to append cap hooks for vlad deploys
jferris authored
128 And I run the hoptoad generator with "-k myapikey"
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
133 And I configure the Hoptoad 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"
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
136 And I configure my application to require the "hoptoad_notifier" gem
137 And I run the hoptoad 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
139 And I should receive a Hoptoad notification
140 And I should see the Rails version
141 And my Hoptoad configuration should contain the following line:
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
142 """
143 config.api_key = ENV['HOPTOAD_API_KEY']
144 """
69f406c @jasonm wip: fixing rails3 filter_params and applying params filters to sessi…
jasonm authored
145
146 Scenario: Filtering parameters in a controller
147 When I generate a new Rails application
148 And I configure the Hoptoad shim
149 And I configure my application to require the "hoptoad_notifier" gem
150 And I run the hoptoad generator with "-k myapikey"
151 When I configure the notifier to use the following configuration lines:
152 """
153 config.api_key = "myapikey"
154 config.params_filters << "credit_card_number"
155 """
156 And I define a response for "TestController#index":
157 """
158 params[:credit_card_number] = "red23"
159 raise RuntimeError, "some message"
160 """
161 And I route "/test/index" to "test#index"
162 And I perform a request to "http://example.com:123/test/index?param=value"
163 Then I should receive the following Hoptoad notification:
164 | component | test |
165 | action | index |
166 | error message | RuntimeError: some message |
167 | error class | RuntimeError |
168 | parameters | credit_card_number: [FILTERED] |
169 | url | http://example.com:123/test/index?param=value |
170
171 Scenario: Filtering session in a controller
172 When I generate a new Rails application
173 And I configure the Hoptoad shim
174 And I configure my application to require the "hoptoad_notifier" gem
175 And I run the hoptoad generator with "-k myapikey"
176 When I configure the notifier to use the following configuration lines:
177 """
178 config.api_key = "myapikey"
179 config.params_filters << "secret"
180 """
181 And I define a response for "TestController#index":
182 """
183 session["secret"] = "blue42"
184 raise RuntimeError, "some message"
185 """
186 And I route "/test/index" to "test#index"
187 And I perform a request to "http://example.com:123/test/index?param=value"
188 Then I should receive the following Hoptoad notification:
189 | component | test |
190 | action | index |
191 | error message | RuntimeError: some message |
192 | error class | RuntimeError |
193 | session | secret: [FILTERED] |
194 | url | http://example.com:123/test/index?param=value |
195
196 Scenario: Filtering session and params based on Rails parameter filters
197 When I generate a new Rails application
198 And I configure the Hoptoad shim
199 And I configure my application to require the "hoptoad_notifier" gem
200 And I run the hoptoad generator with "-k myapikey"
201 And I configure the application to filter parameter "secret"
202 And I define a response for "TestController#index":
203 """
204 params["secret"] = "red23"
205 session["secret"] = "blue42"
206 raise RuntimeError, "some message"
207 """
208 And I route "/test/index" to "test#index"
209 And I perform a request to "http://example.com:123/test/index?param=value"
210 Then I should receive the following Hoptoad notification:
211 | component | test |
212 | action | index |
213 | error message | RuntimeError: some message |
214 | error class | RuntimeError |
215 | params | secret: [FILTERED] |
216 | session | secret: [FILTERED] |
217 | 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
218
219 Scenario: Notify hoptoad within the controller
220 When I generate a new Rails application
221 And I configure the Hoptoad shim
222 And I configure my application to require the "hoptoad_notifier" gem
223 And I run the hoptoad generator with "-k myapikey"
224 And I define a response for "TestController#index":
225 """
226 session[:value] = "test"
227 notify_hoptoad(RuntimeError.new("some message"))
228 render :nothing => true
229 """
230 And I route "/test/index" to "test#index"
231 And I perform a request to "http://example.com:123/test/index?param=value"
232 Then I should receive the following Hoptoad notification:
233 | component | test |
234 | action | index |
235 | error message | RuntimeError: some message |
236 | error class | RuntimeError |
237 | session | value: test |
238 | parameters | param: value |
239 | url | http://example.com:123/test/index?param=value |
Something went wrong with that request. Please try again.