summaryrefslogtreecommitdiff
path: root/spec/support/sessions_helper.rb
blob: 025f47ed439d3113a4ef72ca4ace43498d1511cf (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 = { credentials: { email: user.email, password: user.password } }
    post('/api/login', params: user_params)
    JSON.parse(response.body)
  end
end