Skip to content

Would be nice to have AuthHelpers included #21

@ZenCocoon

Description

@ZenCocoon

For RSpec 3+

spec/rails_helper.rb

RSpec.configure do |config|
  config.include AuthHelpers
end

spec/support/auth_helpers.rb

module AuthHelpers
  def sign_in(account)
    allow(@controller).to receive(:authenticate_account!).and_return(true)
    allow(@controller).to receive(:current_account).and_return(account)
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions