File tree Expand file tree Collapse file tree 5 files changed +51
-0
lines changed
spec/controllers/locations_controller Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ gem 'squeel', '0.9.3'
10
10
gem 'resque' , git : 'git://github.com/defunkt/resque.git' # waiting for 1.19.1
11
11
gem 'resque-scheduler' , '1.9.9'
12
12
gem 'kaminari' , '0.12.4'
13
+ gem 'twitter' , '2.0.1'
13
14
14
15
# Gems used only for assets and not required
15
16
# in production environments by default.
Original file line number Diff line number Diff line change 86
86
railties (>= 3.0.0 )
87
87
faker (1.0.1 )
88
88
i18n (~> 0.4 )
89
+ faraday (0.7.5 )
90
+ addressable (~> 2.2.6 )
91
+ multipart-post (~> 1.1.3 )
92
+ rack (>= 1.1.0 , < 2 )
89
93
ffi (1.0.9 )
90
94
foreman (0.25.0 )
91
95
term-ansicolor (~> 1.0.5 )
131
135
mime-types (1.17.2 )
132
136
multi_json (1.0.3 )
133
137
multi_xml (0.4.1 )
138
+ multipart-post (1.1.4 )
134
139
nokogiri (1.5.0 )
135
140
pg (0.11.0 )
136
141
polyamorous (0.5.0 )
206
211
ffi (= 1.0.9 )
207
212
json_pure
208
213
rubyzip
214
+ simple_oauth (0.1.5 )
209
215
sinatra (1.3.1 )
210
216
rack (~> 1.3 , >= 1.3.4 )
211
217
rack-protection (~> 1.1 , >= 1.1.2 )
226
232
treetop (1.4.10 )
227
233
polyglot
228
234
polyglot (>= 0.3.1 )
235
+ twitter (2.0.1 )
236
+ activesupport (>= 2.3.9 , < 4 )
237
+ faraday (~> 0.7 )
238
+ multi_json (~> 1.0 )
239
+ simple_oauth (~> 0.1 )
229
240
tzinfo (0.3.31 )
230
241
uglifier (1.0.4 )
231
242
execjs (>= 0.3.0 )
@@ -270,5 +281,6 @@ DEPENDENCIES
270
281
spork (~> 0.9.0.rc9 )
271
282
squeel (= 0.9.3 )
272
283
timecop (~> 0.3.5 )
284
+ twitter (= 2.0.1 )
273
285
uglifier (>= 1.0.3 )
274
286
webmock (~> 1.7.5 )
Original file line number Diff line number Diff line change @@ -27,6 +27,32 @@ Feature: Alerts
27
27
"Example" is not returning status codes of "200".
28
28
"""
29
29
30
+ ##################################################
31
+
32
+ Scenario : Twitter alert when site goes down
33
+ Given requests to "http://example.com" are returning the status code "500"
34
+ And my Twitter username is "twituser"
35
+ And my last Twitter update was "Hello, world"
36
+
37
+ When I link my Twitter account
38
+ And I add the URL:
39
+ | Title | Example |
40
+ | URL | http ://example .com |
41
+ | Seconds | 60 |
42
+ And I add the alert:
43
+ | For | Example |
44
+ | Response status code is not | 200 |
45
+ | Times in a row | 5 |
46
+ | Alert via | Twitter : twituser |
47
+ And 4 minutes pass
48
+ Then my last Twitter update should be "Hello, world"
49
+
50
+ When 1 minute passes
51
+ Then my last Twitter update should be:
52
+ """
53
+ "Example" is not returning status codes of "200"
54
+ """
55
+
30
56
##################################################
31
57
32
58
Scenario Outline : Can't add alerts without URLs or email callbacks
Original file line number Diff line number Diff line change
1
+ Given /^my Twitter username is "([^"]*)"$/ do |username |
2
+ pending # express the regexp above with the code you wish you had
3
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe LocationsController , "instance methods" do
4
+ subject { controller }
5
+
6
+ describe "location" do
7
+
8
+ end
9
+ end
You can’t perform that action at this time.
0 commit comments