Sha256: 769fe1d11fdfa48d77c07cd4a2eb7cb89003c3f11802b061f4399a2e73857f0a

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

module Authenticate
  module Testing

    # Helpers for controller tests/specs.
    #
    # Example:
    #
    #   describe DashboardsController do
    #     describe '#show' do
    #       it 'shows view' do
    #         user = create(:user)
    #         login_as(user)
    #         get :show
    #         expect(response).to be_success
    #       end
    #     end
    #   end
    module ControllerHelpers
      def login_as(user)
        controller.login(user)
      end

      def logout
        controller.logout
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authenticate-0.7.3 lib/authenticate/testing/controller_helpers.rb
authenticate-0.7.2 lib/authenticate/testing/controller_helpers.rb
authenticate-0.7.1 lib/authenticate/testing/controller_helpers.rb
authenticate-0.7.0 lib/authenticate/testing/controller_helpers.rb