Skip to content
Browse files

Revert "Update specs to pass on webmock 1.10.0"

This reverts commit 89bbc04.
  • Loading branch information...
1 parent 89bbc04 commit 0ff9f48a012eaae180d2e8d353266b85c9597b4a @sferik committed Mar 2, 2013
View
2 Gemfile
@@ -16,7 +16,7 @@ group :test do
gem 'rspec', '>= 2.11'
gem 'simplecov', :require => false
gem 'timecop'
- gem 'webmock', '>= 1.10'
+ gem 'webmock'
end
gemspec
View
4 spec/twitter/api/direct_messages_spec.rb
@@ -104,11 +104,11 @@
describe "#direct_message_create" do
before do
- stub_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating+a+fixture+for+the+Twitter+gem"}).to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"}).to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.direct_message_create("pengwynn", "Creating a fixture for the Twitter gem")
- expect(a_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating+a+fixture+for+the+Twitter+gem"})).to have_been_made
+ expect(a_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"})).to have_been_made
end
it "returns the sent message" do
direct_message = @client.direct_message_create("pengwynn", "Creating a fixture for the Twitter gem")
View
8 spec/twitter/api/geo_spec.rb
@@ -52,11 +52,11 @@
describe "#similar_places" do
before do
- stub_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter+HQ"}).to_return(:body => fixture("places.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ"}).to_return(:body => fixture("places.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.similar_places(:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ")
- expect(a_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter+HQ"})).to have_been_made
+ expect(a_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ"})).to have_been_made
end
it "returns similar places" do
places = @client.similar_places(:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ")
@@ -67,11 +67,11 @@
describe "#place_create" do
before do
- stub_post("/1.1/geo/place.json").with(:body => {:name => "@sferik's+Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581"}).to_return(:body => fixture("place.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/geo/place.json").with(:body => {:name => "@sferik's Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581"}).to_return(:body => fixture("place.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.place_create(:name => "@sferik's Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581")
- expect(a_post("/1.1/geo/place.json").with(:body => {:name => "@sferik's+Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581"})).to have_been_made
+ expect(a_post("/1.1/geo/place.json").with(:body => {:name => "@sferik's Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581"})).to have_been_made
end
it "returns a place" do
place = @client.place_create(:name => "@sferik's Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581")
View
16 spec/twitter/api/lists_spec.rb
@@ -593,11 +593,11 @@
describe "#list_update" do
context "with a screen name passed" do
before do
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents+of+the+United+States+of+America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents+of+the+United+States+of+America"})).to have_been_made
+ expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"})).to have_been_made
end
it "returns the updated list" do
list = @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
@@ -608,30 +608,30 @@
context "without a screen name passed" do
before do
stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents+of+the+United+States+of+America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.list_update("presidents", :description => "Presidents of the United States of America")
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents+of+the+United+States+of+America"})).to have_been_made
+ expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"})).to have_been_made
end
end
context "with a list ID passed" do
before do
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents+of+the+United+States+of+America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.list_update("sferik", 12345678, :description => "Presidents of the United States of America")
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents+of+the+United+States+of+America"})).to have_been_made
+ expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents of the United States of America"})).to have_been_made
end
end
context "with a list object passed" do
before do
- stub_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents+of+the+United+States+of+America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
list = Twitter::List.new(:id => "12345678", :user => {:id => 7505382, :screen_name => "sferik"})
@client.list_update(list, :description => "Presidents of the United States of America")
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents+of+the+United+States+of+America"})).to have_been_made
+ expect(a_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents of the United States of America"})).to have_been_made
end
end
end
View
4 spec/twitter/api/tweets_spec.rb
@@ -103,11 +103,11 @@
describe "#tweet" do
before do
- stub_post("/1.1/statuses/update.json").with(:body => {:status => "The+problem+with+your+code+is+that+it's+doing+exactly+what+you+told+it+to+do."}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/statuses/update.json").with(:body => {:status => "The problem with your code is that it's doing exactly what you told it to do."}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.update("The problem with your code is that it's doing exactly what you told it to do.")
- expect(a_post("/1.1/statuses/update.json").with(:body => {:status => "The+problem+with+your+code+is+that+it's+doing+exactly+what+you+told+it+to+do."})).to have_been_made
+ expect(a_post("/1.1/statuses/update.json").with(:body => {:status => "The problem with your code is that it's doing exactly what you told it to do."})).to have_been_made
end
it "returns a Tweet" do
tweet = @client.update("The problem with your code is that it's doing exactly what you told it to do.")
View
4 spec/twitter/api/users_spec.rb
@@ -513,11 +513,11 @@
describe "#user_search" do
before do
- stub_get("/1.1/users/search.json").with(:query => {:q => "Erik+Michaels-Ober"}).to_return(:body => fixture("user_search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_get("/1.1/users/search.json").with(:query => {:q => "Erik Michaels-Ober"}).to_return(:body => fixture("user_search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.user_search("Erik Michaels-Ober")
- expect(a_get("/1.1/users/search.json").with(:query => {:q => "Erik+Michaels-Ober"})).to have_been_made
+ expect(a_get("/1.1/users/search.json").with(:query => {:q => "Erik Michaels-Ober"})).to have_been_made
end
it "returns an array of user search results" do
user_search = @client.user_search("Erik Michaels-Ober")

0 comments on commit 0ff9f48

Please sign in to comment.
Something went wrong with that request. Please try again.