Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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