Skip to content

Commit bde9426

Browse files
author
Austin Schneider
committed
WIP twitter
1 parent caa7457 commit bde9426

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ gem 'squeel', '0.9.3'
1010
gem 'resque', git: 'git://github.com/defunkt/resque.git' # waiting for 1.19.1
1111
gem 'resque-scheduler', '1.9.9'
1212
gem 'kaminari', '0.12.4'
13+
gem 'twitter', '2.0.1'
1314

1415
# Gems used only for assets and not required
1516
# in production environments by default.

Gemfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ GEM
8686
railties (>= 3.0.0)
8787
faker (1.0.1)
8888
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)
8993
ffi (1.0.9)
9094
foreman (0.25.0)
9195
term-ansicolor (~> 1.0.5)
@@ -131,6 +135,7 @@ GEM
131135
mime-types (1.17.2)
132136
multi_json (1.0.3)
133137
multi_xml (0.4.1)
138+
multipart-post (1.1.4)
134139
nokogiri (1.5.0)
135140
pg (0.11.0)
136141
polyamorous (0.5.0)
@@ -206,6 +211,7 @@ GEM
206211
ffi (= 1.0.9)
207212
json_pure
208213
rubyzip
214+
simple_oauth (0.1.5)
209215
sinatra (1.3.1)
210216
rack (~> 1.3, >= 1.3.4)
211217
rack-protection (~> 1.1, >= 1.1.2)
@@ -226,6 +232,11 @@ GEM
226232
treetop (1.4.10)
227233
polyglot
228234
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)
229240
tzinfo (0.3.31)
230241
uglifier (1.0.4)
231242
execjs (>= 0.3.0)
@@ -270,5 +281,6 @@ DEPENDENCIES
270281
spork (~> 0.9.0.rc9)
271282
squeel (= 0.9.3)
272283
timecop (~> 0.3.5)
284+
twitter (= 2.0.1)
273285
uglifier (>= 1.0.3)
274286
webmock (~> 1.7.5)

features/alerts.feature

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,32 @@ Feature: Alerts
2727
"Example" is not returning status codes of "200".
2828
"""
2929

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+
3056
##################################################
3157

3258
Scenario Outline: Can't add alerts without URLs or email callbacks
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Given /^my Twitter username is "([^"]*)"$/ do |username|
2+
pending # express the regexp above with the code you wish you had
3+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'spec_helper'
2+
3+
describe LocationsController, "instance methods" do
4+
subject { controller }
5+
6+
describe "location" do
7+
8+
end
9+
end

0 commit comments

Comments
 (0)