Sha256: 33c8ecaf9f09ad0a1658c0b27d3cfd7c574c5291046062a853bcefb2772c19a3

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

module OpenStax
  module Accounts

    describe SessionsCallback do

      context "faculty_status" do
        it "should deal with faculty status it doesn't know (e.g. if Accounts updated but this repo not)" do
          result = described_class.handle(request: mock_omniauth_request(faculty_status: "howdy_ho"))
          expect(result.outputs.account).to be_no_faculty_info
        end

        it "should deal with faculty status that is not present" do
          request = mock_omniauth_request()
          remove_faculty_status!(request)
          result = described_class.handle(request: request)
          expect(result.outputs.account).to be_no_faculty_info
        end

        it "should deal with null nickname" do
          with_stubbing(false) do
            request = mock_omniauth_request
            remove_nickname!(request)
            result = described_class.handle(request: request)
            expect(result.outputs.account).to be_valid
            expect(result.outputs.account).to be_persisted
          end
        end
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openstax_accounts-7.4.0 spec/handlers/openstax/accounts/sessions_callback_spec.rb
openstax_accounts-7.3.0 spec/handlers/openstax/accounts/sessions_callback_spec.rb