summaryrefslogtreecommitdiff
path: root/spec/requests/cards_controller/destroy_spec.rb
blob: 5ade11f5b2eef236aca843a528fb16dfa59c495b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'DELETE /api/account/cards/card_id', type: :request do
  let(:user) { create(:user_account, role: 'regular') }
  let(:token) { jwt(user) }
  let(:headers) { { 'Authorization' => "Bearer #{token['token']}" } }
  let(:card) { create(:card, user_account: user) }

  it_behaves_like 'a DELETE request' do
    let(:resource) { "/api/account/cards/#{card.id}" }
    let(:nonexistent_resource) { "/api/account/cards/#{SecureRandom.hex(8)}" }
  end
end