summaryrefslogtreecommitdiff
path: root/spec/support/sessions_helper.rb
blob: 1508c7ea040ecc492a52f025033d644b8013b404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

require 'rails_helper'

# Module to generate JWTs for use in specs.
module SessionsHelper
  def jwt(user)
    user_params = { email: user.email, password: user.password }
    post('/api/login', params: user_params)
    JSON.parse(response.body)
  end
end