Skip to content

Instantly share code, notes, and snippets.

@bookwyrm
Last active December 22, 2015 07:19
Show Gist options
  • Save bookwyrm/6436974 to your computer and use it in GitHub Desktop.
Save bookwyrm/6436974 to your computer and use it in GitHub Desktop.
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