Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 137 lines (123 sloc) 6.288 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
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris 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
36 Scenario: Try to install without an api key
37 When I generate a new Rails application
38 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
39 And I run the hoptoad generator with ""
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
40 Then I should see "Must pass --api-key or create config/initializers/hoptoad.rb"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
41
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
42 Scenario: Configure and deploy using only installed gem
2be23d7 @jferris Fixed capistrano recipes
jferris authored
43 When I generate a new Rails application
44 And I run "capify ."
45 And I configure the Hoptoad shim
46 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
47 And I run the hoptoad generator with "-k myapikey"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
48 And I run "cap -T"
49 Then I should see "deploy:notify_hoptoad"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
50
51 Scenario: Configure and deploy using only vendored gem
52 When I generate a new Rails application
53 And I run "capify ."
54 And I configure the Hoptoad shim
55 And I configure my application to require the "hoptoad_notifier" gem
56 And I unpack the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
57 And I run the hoptoad generator with "-k myapikey"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
58 And I uninstall the "hoptoad_notifier" gem
e6f87a5 @jferris Added a capistrano hook for Rails 3
jferris authored
59 And I install cached gems
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
60 And I run "cap -T"
61 Then I should see "deploy:notify_hoptoad"
c1da35c LH-591 Notifier generator checks the presence of the hoptoad_notifier…
damselem authored
62
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
63 Scenario: Try to install when the hoptoad_notifier plugin still exists
64 When I generate a new Rails application
65 And I install the "hoptoad_notifier" plugin
66 And I configure the Hoptoad shim
67 And I configure the notifier to use "myapikey" as an API key
68 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
69 And I run the hoptoad generator with ""
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
70 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
71
72 Scenario: Rescue an exception in a controller
73 When I generate a new Rails application
74 And I configure the Hoptoad shim
75 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
76 And I run the hoptoad generator with "-k myapikey"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
77 And I define a response for "TestController#index":
78 """
79 session[:value] = "test"
80 raise RuntimeError, "some message"
81 """
1bab4e3 @jferris Extract request info from rack env
jferris authored
82 And I route "/test/index" to "test#index"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
83 And I perform a request to "http://example.com:123/test/index?param=value"
84 Then I should receive the following Hoptoad notification:
85 | component | test |
86 | action | index |
87 | error message | RuntimeError: some message |
88 | error class | RuntimeError |
89 | session | value: test |
90 | parameters | param: value |
91 | url | http://example.com:123/test/index?param=value |
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
92
93 Scenario: The gem should not be considered a framework gem
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"
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
98 And I run "rake gems"
99 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
100
101 Scenario: The app uses Vlad instead of Capistrano
102 When I generate a new Rails application
103 And I configure the Hoptoad shim
104 And I configure my application to require the "hoptoad_notifier" gem
105 And I run "touch config/deploy.rb"
106 And I run "rm Capfile"
6ed1a80 @jferris Fixed Rails 3 generator not to append cap hooks for vlad deploys
jferris authored
107 And I run the hoptoad generator with "-k myapikey"
108 Then "config/deploy.rb" should not contain "capistrano"
abb2040 @jasonm Added feature: Support the Heroku addon in the generator
jasonm authored
109
110 @wip
111 Scenario: Support the Heroku addon in the generator
112 When I generate a new Rails application
113 And I configure the Hoptoad shim
114 And I configure my application to require the "hoptoad_notifier" gem
115 And I run the hoptoad generator with "--heroku"
116 Then my initializer should contain the following line:
117 """
118 config.api_key = ENV['HOPTOAD_API_KEY']
119 """
120 When I export the environment variable HOPTOAD_API_KEY" to be "myapikey"
121 And I define a response for "TestController#index":
122 """
123 session[:value] = "test"
124 raise RuntimeError, "some message"
125 """
126 And I route "/test/index" to "test#index"
127 And I perform a request to "http://example.com:123/test/index?param=value"
128 Then I should receive the following Hoptoad notification:
129 | component | test |
130 | action | index |
131 | error message | RuntimeError: some message |
132 | error class | RuntimeError |
133 | session | value: test |
134 | parameters | param: value |
135 | url | http://example.com:123/test/index?param=value |
136
Something went wrong with that request. Please try again.