The twitter gem now requires a proper Content-Type

This commit is contained in:
Akinori MUSHA 2017-01-19 15:39:20 +09:00
parent 7663698673
commit c1b786018f
3 changed files with 4 additions and 0 deletions

View file

@ -4,6 +4,7 @@ describe Agents::TwitterFavorites do
before do
stub_request(:any, /tectonic.*[?&]tweet_mode=extended/).
to_return(body: File.read(Rails.root.join("spec/data_fixtures/user_fav_tweets.json")),
headers: { 'Content-Type': 'application/json;charset=utf-8' },
status: 200)
end

View file

@ -5,7 +5,9 @@ describe Agents::TwitterSearchAgent do
# intercept the twitter API request
stub_request(:any, /freebandnames.*[?&]tweet_mode=extended/).
to_return(body: File.read(Rails.root.join("spec/data_fixtures/search_tweets.json")),
headers: { 'Content-Type': 'application/json;charset=utf-8' },
status: 200)
@opts = {
search: "freebandnames",
expected_update_period_in_days: "2",

View file

@ -5,6 +5,7 @@ describe Agents::TwitterUserAgent do
# intercept the twitter API request for @tectonic's user profile
stub_request(:any, "https://api.twitter.com/1.1/statuses/user_timeline.json?contributor_details=true&count=200&exclude_replies=false&include_entities=true&include_rts=true&screen_name=tectonic&tweet_mode=extended").
to_return(body: File.read(Rails.root.join("spec/data_fixtures/user_tweets.json")),
headers: { 'Content-Type': 'application/json;charset=utf-8' },
status: 200)
@opts = {