Skip to content

Commit

Permalink
feat: add specs for delete
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomiguelpinto committed Jul 8, 2024
1 parent d729238 commit fae13e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/requests/api/v1/fees_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@
expect(response).to have_http_status(:ok)
end
end

context 'when fee exist but is attached to an invoice' do
let(:invoice) { create(:invoice, organization:, customer:) }
let(:fee) do
create(:charge_fee, fee_type: 'charge', pay_in_advance: true, subscription:, invoice:)
end

it 'dont delete the fee' do
delete_with_token(organization, "/api/v1/fees/#{fee.id}")
expect(response).to have_http_status(:method_not_allowed)
end
end
end

describe 'GET /fees' do
Expand Down

0 comments on commit fae13e2

Please sign in to comment.