summaryrefslogtreecommitdiff
path: root/spec/controllers/products_controller_spec.rb
blob: d4f1373db8b4792a5d1de20ff45eac96200bdb6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Api::ProductsController, type: :controller do
  let(:product) { create(:product) }

  it { should route(:post, '/api/products').to(action: :create) }
  it { should route(:put, "/api/products#{product.public_id}").to(action: :update, id: product.public_id) }
  it { should route(:get, '/api/products').to(action: :index) }
  it { should route(:get, "/api/products/#{product.public_id}").to(action: :show, id: product.public_id) }
  it { should route(:delete, "/api/products/#{product.public_id}").to(action: :destroy, id: product.public_id) }
end