Sha256: fcf39be960471bc60c3eb5f5d0d174708d23b76da8fcbe3d17d67072f0691f83
Contents?: true
Size: 663 Bytes
Versions: 21
Compression:
Stored size: 663 Bytes
Contents
require 'spec_helper' describe CoalescingPanda::Oauth2Controller, :type => :controller do routes { CoalescingPanda::Engine.routes } describe "#redirect" do it 'creates a token in the db' do ENV['OAUTH_PROTOCOL'] = 'http' Bearcat::Client.any_instance.stub(retrieve_token: 'foobar') get :redirect, {user_id: 1, api_domain:'foo.com', code:'bar'} auth = CoalescingPanda::CanvasApiAuth.find_by_user_id_and_api_domain(1, 'foo.com') auth.should_not == nil end it "doesn't create a token in the db" do get :redirect, {error: 'your face'} CoalescingPanda::CanvasApiAuth.all.count.should == 0 end end end
Version data entries
21 entries across 21 versions & 1 rubygems