Skip to content

Instantly share code, notes, and snippets.

View niinyarko's full-sized avatar

Laud Bruce-Tagoe niinyarko

  • GitHub Staff
View GitHub Profile
@niinyarko
niinyarko / create_spec.rb
Last active November 16, 2021 19:03
Request Spec Example for Devise Token Auth Gem with Rails 5.1
# Example Request
# My Devise model is named Merchant
# Key lines to note are 16, 21, 27, 28, 29
require 'rails_helper'
RSpec.describe 'POST /api/v2/customer_groups', type: :request do
let(:merchant) { FactoryGirl.create(:merchant) }
let(:user) { FactoryGirl.create(:user) }
let(:customer) { merchant.customers.create(user_id: user.id)}
let(:params) {{