Sha256: 342d0a802489968cb6374117ca01b20d9b3aca2e5ed743d6312e447ec2f7ec8d

Contents?: true

Size: 811 Bytes

Versions: 1

Compression:

Stored size: 811 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)

describe OAuth2::Grant::RefreshToken do

  before :all do
    @host           = 'example.com'
    @client_id      = 's6BhdRkqt3'
    @client_secret  = 'SplxlOBeZQQYbYS6WxSbIA'
    @client = OAuth2::Client.new(@host, @client_id, @client_secret)
  end
  subject do
    OAuth2::Grant::RefreshToken.new(@client)
  end

  describe "#grant_type" do
    it "returns grant type" do
      expect(subject.grant_type).to eq 'refresh_token'
    end
  end

  describe "#get_token" do
    it "gets access token" do
      subject.should_receive(:make_request).with(:post, "/oauth2/token", {:params=>{:grant_type=>"refresh_token", :refresh_token=>"2YotnFZFEjr1zCsicMWpAA"}, :authenticate=>:headers})
      subject.get_token('2YotnFZFEjr1zCsicMWpAA')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oauth2-client-1.0.0 spec/oauth2/grant/refresh_token_spec.rb