spec/twitter/client/user_spec.rb in twitter4r-0.5.0 vs spec/twitter/client/user_spec.rb in twitter4r-0.5.1
- old
+ new
@@ -17,16 +17,16 @@
Twitter::User.stub!(:unmarshal).and_return(@user)
Net::HTTP.stub!(:new).and_return(@connection)
end
it "should create expected HTTP GET request when giving numeric user id" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:info]}?#{{:user_id => @id}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:info], {:user_id => @id}).and_return(@response)
@twitter.user(@id)
end
it "should create expected HTTP GET request when giving screen name" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:info]}?#{{:screen_name => @screen_name}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:info], {:screen_name => @screen_name}).and_return(@response)
@twitter.user(@screen_name)
end
it "should bless model returned when giving numeric user id" do
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
@@ -62,26 +62,26 @@
Twitter::User.stub!(:unmarshal).and_return(@user)
Net::HTTP.stub!(:new).and_return(@connection)
end
it "should create expected HTTP GET request when giving numeric user id" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:friends]}?#{{:user_id => @id}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:user_id => @id}).and_return(@response)
@twitter.user(@id, :friends)
end
it "should invoke #to_i on Twitter::User objecct given" do
@user.should_receive(:to_i).and_return(@id)
@twitter.user(@user, :friends)
end
it "should create expected HTTP GET request when giving Twitter::User object" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:friends]}?#{{:user_id => @user.to_i}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:user_id => @user.to_i}).and_return(@response)
@twitter.user(@user, :friends)
end
it "should create expected HTTP GET request when giving screen name" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:friends]}?#{{:screen_name => @screen_name}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:screen_name => @screen_name}).and_return(@response)
@twitter.user(@screen_name, :friends)
end
it "should bless model returned when giving numeric id" do
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
@@ -120,11 +120,11 @@
Net::HTTP.stub!(:new).and_return(@connection)
Twitter::User.stub!(:unmarshal).and_return(@user)
end
it "should create expected HTTP GET request" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:info]}?#{{:id => @screen_name}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:info], {:id => @screen_name}).and_return(@response)
@twitter.my(:info)
end
it "should bless the model object returned" do
@twitter.should_receive(:bless_models).with(@user).and_return(@user)
@@ -158,10 +158,10 @@
Twitter::User.stub!(:unmarshal).and_return(@friends)
Net::HTTP.stub!(:new).and_return(@connection)
end
it "should create expected HTTP GET request" do
- @twitter.should_receive(:rest_oauth_connect).with(:get, "#{@uris[:friends]}?#{{:id => @screen_name}.to_http_str}").and_return(@response)
+ @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:id => @screen_name}).and_return(@response)
@twitter.my(:friends)
end
it "should bless models returned" do
@twitter.should_receive(:bless_models).with(@friends).and_return(@friends)