Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3 from ombulabs/feature/revert-back-to-mentions-t…
Browse files Browse the repository at this point in the history
…imeline

Feature/revert back to mentions timeline
  • Loading branch information
etagwerker committed Nov 5, 2015
2 parents 135c835 + e09c26d commit 97566d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/services/twitter_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def download_tweets
opts[:since_id] = tweet.id
end

tl = client.user_timeline('InfractoresBA', opts)
tl = client.mentions_timeline(opts)

tl.each do |tuit|
Tweet.find_or_create!(tuit)
Expand Down
12 changes: 8 additions & 4 deletions spec/services/twitter_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
context "search and mentions return only one tweet" do
before do
allow(twitter_service.client)
.to(receive(:user_timeline)
.to(receive(:mentions_timeline)
.and_return([tweet]))
allow(twitter_service.client)
.to(receive(:search)
Expand All @@ -52,7 +52,9 @@

it 'create tweet' do
expect do
twitter_service.download_tweets
VCR.use_cassette("user-tweets") do
twitter_service.download_tweets
end
end.to change(Tweet, :count).by(1)
end
end
Expand All @@ -62,7 +64,9 @@

it 'create tweet' do
expect do
twitter_service.download_tweets
VCR.use_cassette("user-tweets") do
twitter_service.download_tweets
end
end.to change(Tweet, :count).by(1)
end
end
Expand All @@ -74,7 +78,7 @@
VCR.use_cassette("user-tweets") do
twitter_service.download_tweets
end
end.to change(Tweet, :count).by(9)
end.to change(Tweet, :count).by(22)
end
end
end
Expand Down

0 comments on commit 97566d1

Please sign in to comment.