Updated the configuration handling code.

git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@10 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
This commit is contained in:
bobaman@google.com committed 2010-08-14 01:16:35 +00:00
1 parent 0d45cbe27b
commit a6d7aa570e
4 files changed
+94 -1

No files matched your search

@@ -57,3 +57,28 @@ describe Google::APIClient::OAuth1, "in the default configuration" do
end).should raise_error(TypeError)
end
end
describe Google::APIClient::OAuth1, "configured for use with bogus service" do
before do
@oauth = Google::APIClient::OAuth1.new(:service => :bogus)
end
it "should have the default configuration" do
@oauth.request_token_uri.should ==
Google::APIClient::OAuth1::DEFAULTS[:request_token_uri]
@oauth.authorization_endpoint_uri.should ==
Google::APIClient::OAuth1::DEFAULTS[:authorization_uri]
@oauth.access_token_uri.should ==
Google::APIClient::OAuth1::DEFAULTS[:access_token_uri]
@oauth.scopes.should ==
Google::APIClient::OAuth1::DEFAULTS[:scopes]
@oauth.callback.should ==
Google::APIClient::OAuth1::DEFAULTS[:callback]
@oauth.display_name.should ==
Google::APIClient::OAuth1::DEFAULTS[:display_name]
@oauth.consumer_key.should ==
Google::APIClient::OAuth1::DEFAULTS[:consumer_key]
@oauth.consumer_secret.should ==
Google::APIClient::OAuth1::DEFAULTS[:consumer_secret]
end
end
@@ -23,6 +23,13 @@ describe Google::APIClient::OAuth1, "configured for use with Buzz" do
@oauth = Google::APIClient::OAuth1.new(:service => :buzz)
end
it "should not have the default configuration" do
@oauth.authorization_endpoint_uri.should_not ==
Google::APIClient::OAuth1::DEFAULTS[:authorization_uri]
@oauth.scopes.should_not ==
Google::APIClient::OAuth1::DEFAULTS[:scopes]
end
it "should have the correct authorization_uri" do
@oauth.authorization_endpoint_uri.should ==
"https://www.google.com/buzz/api/auth/OAuthAuthorizeToken"