Sha256: 26cb3aebbfc51c0eadb9bf02a1fcd2b06eadec4ecfea4dc7a140263fe5602859

Contents?: true

Size: 409 Bytes

Versions: 10

Compression:

Stored size: 409 Bytes

Contents

require 'authenticate/controller'

module Controllers
  # Helpers for controller tests
  module ControllerHelpers
    def sign_in
      user = create(:user)
      sign_in_as user
    end

    def sign_in_as(user)
      controller.login user
    end

    def sign_out
      controller.logout
    end
  end
end

RSpec.configure do |config|
  config.include Controllers::ControllerHelpers, type: :controller
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authenticate-0.7.3 spec/support/controllers/controller_helpers.rb
authenticate-0.7.2 spec/support/controllers/controller_helpers.rb
authenticate-0.7.1 spec/support/controllers/controller_helpers.rb
authenticate-0.7.0 spec/support/controllers/controller_helpers.rb
authenticate-0.6.1 spec/support/controllers/controller_helpers.rb
authenticate-0.6.0 spec/support/controllers/controller_helpers.rb
authenticate-0.5.0 spec/support/controllers/controller_helpers.rb
authenticate-0.4.0 spec/support/controllers/controller_helpers.rb
authenticate-0.3.3 spec/support/controllers/controller_helpers.rb
authenticate-0.3.2 spec/support/controllers/controller_helpers.rb