Sha256: af16f1cd31286a36fcdc426e1323d847ec238be377a9512198d6d3b497f4ac00

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper'

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

      let!(:account) { FactoryGirl.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, id: account.id
        expect(controller.current_account).to eq(account)
        expect(controller.current_account.is_anonymous?).to eq(false)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openstax_accounts-3.1.1 spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb
openstax_accounts-3.1.0 spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb
openstax_accounts-3.0.0 spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb