Sha256: 2d921baac36d2a995cf90a846d4c721b072857456568d8e8415960d4ae93bd0a
Contents?: true
Size: 1.02 KB
Versions: 17
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper.rb' describe Rack::OAuth2::Client::Grant::AuthorizationCode do let(:redirect_uri) { 'https://client.example.com/callback' } let(:grant) { Rack::OAuth2::Client::Grant::AuthorizationCode } context 'when code is given' do let :attributes do {:code => 'code'} end context 'when redirect_uri is given' do let :attributes do {:code => 'code', :redirect_uri => redirect_uri} end subject { grant.new attributes } its(:redirect_uri) { should == redirect_uri } its(:as_json) do should == {:grant_type => :authorization_code, :code => 'code', :redirect_uri => redirect_uri} end end context 'otherwise' do subject { grant.new attributes } its(:redirect_uri) { should be_nil } its(:as_json) do should == {:grant_type => :authorization_code, :code => 'code', :redirect_uri => nil} end end end context 'otherwise' do it do expect { grant.new }.to raise_error AttrRequired::AttrMissing end end end
Version data entries
17 entries across 17 versions & 2 rubygems