Sha256: fa5779436a5e1b451a694e9c30689d0b3ea94c7f01f8d43df961821610c23929

Contents?: true

Size: 699 Bytes

Versions: 5

Compression:

Stored size: 699 Bytes

Contents

require 'spec_helper'

module OpenStax::Accounts
  module Dev
    describe UsersController do
      routes { OpenStax::Accounts::Engine.routes }

      let!(:user) { OpenStax::Accounts::User.create(username: 'some_user',
                                                    openstax_uid: 1) }

      it 'should allow users not in production to become other users' do
        expect(controller.current_user).to eq(OpenStax::Accounts::User.anonymous)
        expect(controller.current_user.is_anonymous?).to eq(true)
        get :become, user_id: user.id
        expect(controller.current_user).to eq(user)
        expect(controller.current_user.is_anonymous?).to eq(false)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
openstax_accounts-0.3.0 spec/controllers/openstax/accounts/dev/users_controller_spec.rb
openstax_accounts-0.3 spec/controllers/openstax/accounts/dev/users_controller_spec.rb
openstax_accounts-0.2.1 spec/controllers/openstax/accounts/dev/users_controller_spec.rb
openstax_accounts-0.2.0 spec/controllers/openstax/accounts/dev/users_controller_spec.rb
openstax_accounts-0.1.0 spec/controllers/openstax/accounts/dev/users_controller_spec.rb