Skip to content

Commit

Permalink
added site parameter to consumer oauth options
Browse files Browse the repository at this point in the history
  • Loading branch information
renatosnrg committed May 9, 2011
1 parent 3b660ce commit 90b6641
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/linked_in/helpers/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def parse_oauth_options
:request_token_url => full_oauth_url_for(:request_token, :api_host),
:access_token_url => full_oauth_url_for(:access_token, :api_host),
:authorize_url => full_oauth_url_for(:authorize, :auth_host),
:site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host]
}
end

Expand Down
6 changes: 5 additions & 1 deletion spec/cases/oauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
let(:consumer) { client.consumer }

it "should return a configured OAuth consumer" do
consumer.site.should == ''
consumer.site.should == 'https://api.linkedin.com'
consumer.request_token_url.should == 'https://api.linkedin.com/uas/oauth/requestToken'
consumer.access_token_url.should == 'https://api.linkedin.com/uas/oauth/accessToken'
consumer.authorize_url.should == 'https://www.linkedin.com/uas/oauth/authorize'
Expand All @@ -29,6 +29,7 @@
end

it "should return a configured OAuth consumer" do
consumer.site.should == 'https://api.josh.com'
consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken'
consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken'
consumer.authorize_url.should == 'https://www.josh.com/uas/oauth/authorize'
Expand All @@ -45,6 +46,7 @@
end

it "should return a configured OAuth consumer" do
consumer.site.should == 'https://api.linkedin.com'
consumer.request_token_url.should == 'https://api.linkedin.com/secure/oauth/requestToken'
consumer.access_token_url.should == 'https://api.linkedin.com/secure/oauth/accessToken'
consumer.authorize_url.should == 'https://www.linkedin.com/secure/oauth/authorize'
Expand All @@ -61,6 +63,7 @@
end

it "should return a configured OAuth consumer" do
consumer.site.should == 'https://api.linkedin.com'
consumer.request_token_url.should == 'https://api.josh.com/secure/oauth/requestToken'
consumer.access_token_url.should == 'https://api.josh.com/secure/oauth/accessToken'
consumer.authorize_url.should == 'https://www.josh.com/secure/oauth/authorize'
Expand All @@ -75,6 +78,7 @@
end

it "should return a configured OAuth consumer" do
consumer.site.should == 'https://api.josh.com'
consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken'
consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken'
consumer.authorize_url.should == 'https://api.josh.com/uas/oauth/authorize'
Expand Down

2 comments on commit 90b6641

@johncant
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this "https://api.josh.com" ?

@renatosnrg
Copy link
Owner Author

@renatosnrg renatosnrg commented on 90b6641 Aug 3, 2011 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.