Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 106 lines (94 sloc) 4.906 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
1f87891 @jferris Added integration coverage and fixes for older versions of Rails
jferris authored
23 And I run "rake hoptoad:test"
641d2ca @jferris Got the generator running and a request dispatched to the test endpoint
jferris authored
24 Then the command should have run successfully
25 And I should receive two Hoptoad notifications
ad3d087 @jferris Changed rake tasks to be included instead of copied
jferris authored
26
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
27 Scenario: Configure the notifier by hand
28 When I generate a new Rails application
29 And I configure the Hoptoad shim
30 And I configure the notifier to use "myapikey" as an API key
31 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
32 And I run the hoptoad generator with ""
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
33 Then I should receive a Hoptoad notification
34
35 Scenario: Try to install without an api key
36 When I generate a new Rails application
37 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
38 And I run the hoptoad generator with ""
022a1a3 @jferris Added scenarios for missing api key/configuring by hand
jferris authored
39 Then I should see "Must pass --api-key or create config/initializers/hoptoad.rb"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
40
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
41 Scenario: Configure and deploy using only installed gem
2be23d7 @jferris Fixed capistrano recipes
jferris authored
42 When I generate a new Rails application
43 And I run "capify ."
44 And I configure the Hoptoad shim
45 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
46 And I run the hoptoad generator with "-k myapikey"
2be23d7 @jferris Fixed capistrano recipes
jferris authored
47 And I run "cap -T"
48 Then I should see "deploy:notify_hoptoad"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
49
50 Scenario: Configure and deploy using only vendored gem
51 When I generate a new Rails application
52 And I run "capify ."
53 And I configure the Hoptoad shim
54 And I configure my application to require the "hoptoad_notifier" gem
55 And I unpack the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
56 And I run the hoptoad generator with "-k myapikey"
f784dec @jferris Fixed deploy hooks not working when the gem isn't installed
jferris authored
57 And I uninstall the "hoptoad_notifier" gem
58 And I run "cap -T"
59 Then I should see "deploy:notify_hoptoad"
c1da35c LH-591 Notifier generator checks the presence of the hoptoad_notifier pl...
damselem authored
60
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
61 Scenario: Try to install when the hoptoad_notifier plugin still exists
62 When I generate a new Rails application
63 And I install the "hoptoad_notifier" plugin
64 And I configure the Hoptoad shim
65 And I configure the notifier to use "myapikey" as an API key
66 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
67 And I run the hoptoad generator with ""
0cd7154 @qrush Updating the uninstall instructions to use script/plugin remove
qrush authored
68 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
69
70 Scenario: Rescue an exception in a controller
71 When I generate a new Rails application
72 And I configure the Hoptoad shim
73 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
74 And I run the hoptoad generator with "-k myapikey"
6fbbe2b @jferris Added integration tests for rescuing
jferris authored
75 And I define a response for "TestController#index":
76 """
77 session[:value] = "test"
78 raise RuntimeError, "some message"
79 """
80 And I perform a request to "http://example.com:123/test/index?param=value"
81 Then I should receive the following Hoptoad notification:
82 | component | test |
83 | action | index |
84 | error message | RuntimeError: some message |
85 | error class | RuntimeError |
86 | session | value: test |
87 | parameters | param: value |
88 | url | http://example.com:123/test/index?param=value |
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
89
90 Scenario: The gem should not be considered a framework gem
91 When I generate a new Rails application
92 And I configure the Hoptoad shim
93 And I configure my application to require the "hoptoad_notifier" gem
912a441 @jasonm Starting to add features for Rails 3
jasonm authored
94 And I run the hoptoad generator with "-k myapikey"
390df9b @jasonm LH-629 Ensure notifier is not considered a framework gem
jasonm authored
95 And I run "rake gems"
96 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 uses...
Dan Lawless authored
97
98 Scenario: The app uses Vlad instead of Capistrano
99 When I generate a new Rails application
100 And I configure the Hoptoad shim
101 And I configure my application to require the "hoptoad_notifier" gem
102 And I run "touch config/deploy.rb"
103 And I run "rm Capfile"
104 And I run "script/generate hoptoad -k myapikey"
105 Then "config/deploy.rb" should not contain text of "generators/hoptoad/templates/capistrano_hook.rb"
Something went wrong with that request. Please try again.