Sha256: 8a0fea4492d085b4725ff603735cbce2fbbb2bd865378a5340bb5032b1813ab8

Contents?: true

Size: 927 Bytes

Versions: 1

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'

module OpenStax::Accounts
  module Dev
    RSpec.describe AccountsController, type: :controller do
      routes { Engine.routes }

      let!(:account) { FactoryBot.create :openstax_accounts_account,
                                          username: 'some_user',
                                          openstax_uid: 10 }

      it 'should allow users not in production to become other users' do
        expect(controller.current_account).to eq(AnonymousAccount.instance)
        expect(controller.current_account.is_anonymous?).to eq(true)
        post :become, params: { id: account.openstax_uid }
        expect(controller.current_account).to eq(account)
        expect(controller.current_account.is_anonymous?).to eq(false)
      end

      it 'should not set X-Frame-Options header' do
        get :index
        expect(response.header['X-Frame-Options']).to be_nil
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openstax_accounts-8.0.0 spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb