spec/cases/oauth_spec.rb in koala-1.3.0rc1 vs spec/cases/oauth_spec.rb in koala-1.3.0rc2
- old
+ new
@@ -348,21 +348,21 @@
describe "for fetching access tokens" do
describe "#get_access_token_info" do
it "uses options[:redirect_uri] if provided" do
uri = "foo"
- Koala.should_receive(:make_request).with(anything, hash_including(:redirect_uri => uri), anything, anything).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, hash_including(:redirect_uri => uri), anything, anything).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_access_token_info(@code, :redirect_uri => uri)
end
it "uses the redirect_uri used to create the @oauth if no :redirect_uri option is provided" do
- Koala.should_receive(:make_request).with(anything, hash_including(:redirect_uri => @callback_url), anything, anything).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, hash_including(:redirect_uri => @callback_url), anything, anything).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_access_token_info(@code)
end
it "makes a GET request" do
- Koala.should_receive(:make_request).with(anything, anything, "get", anything).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, anything, "get", anything).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_access_token_info(@code)
end
if KoalaTest.code
it "properly gets and parses an access token token results into a hash" do
@@ -383,11 +383,11 @@
describe "#get_access_token" do
# TODO refactor these to be proper tests with stubs and tests against real data
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_access_token(@code, options)
end
if KoalaTest.code
it "uses get_access_token_info to get and parse an access token token results" do
@@ -422,11 +422,11 @@
result["access_token"].should
end
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_app_access_token_info(options)
end
end
describe "get_app_acess_token" do
@@ -441,11 +441,11 @@
result.should == original["access_token"]
end
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "", {}))
@oauth.get_app_access_token(options)
end
end
describe "protected methods" do
@@ -522,11 +522,11 @@
lambda { @oauth.get_token_info_from_session_keys(@multiple_session_keys) }.should raise_error(Koala::Facebook::APIError)
end
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "[{}]", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "[{}]", {}))
@oauth.get_token_info_from_session_keys([], options)
end
end
describe "with get_tokens_from_session_keys" do
@@ -554,11 +554,11 @@
result.each_with_index {|r, index| index > 0 ? r.should(be_a(String)) : r.should(be_nil)}
end
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "[{}]", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "[{}]", {}))
@oauth.get_tokens_from_session_keys([], options)
end
end
describe "get_token_from_session_key" do
@@ -584,10 +584,10 @@
result.should be_nil
end
it "passes on any options provided to make_request" do
options = {:a => 2}
- Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::Response.new(200, "[{}]", {}))
+ Koala.should_receive(:make_request).with(anything, anything, anything, hash_including(options)).and_return(Koala::HTTPService::Response.new(200, "[{}]", {}))
@oauth.get_token_from_session_key("", options)
end
end
else
it "Session key exchange tests will not be run since the session key in facebook_data.yml is blank."