Last active
December 22, 2015 07:19
-
-
Save bookwyrm/6436974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe TicketIntegration::Providers::Pivotal do | |
context "when authorizing" do | |
let(:session) { Hash.new } | |
it "builds authorize url" do | |
expect(pivotal.auth_link_url(resource_identifier, session)).to eq("/auth/pivotal/token/#{resource_identifier}") | |
end | |
context "with an invalid token" do | |
before :all do | |
VCR.use_cassette 'TicketIntegration_Providers_Pivotal/authorization_token_invalid' do | |
@response = pivotal.valid_token?(random_string) | |
end | |
end | |
it "fails authorization" do | |
expect(@response).to be_false | |
end | |
end | |
context "with a valid token" do | |
before :all do | |
VCR.use_cassette 'TicketIntegration_Providers_Pivotal/authorization_token_valid' do | |
@response = pivotal.valid_token?($ticket_integration_settings['pivotal-token']) | |
end | |
end | |
it "passes authorization" do | |
expect(@response).to be_true | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment