Skip to content

Commit

Permalink
add missing spec
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrocolic committed Aug 28, 2024
1 parent 82440b5 commit 2d9361e
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,34 @@
expect(breakdown2['type']).to eq('exempt')
end
end

context 'when there is tax error' do
let(:body) do
path = Rails.root.join('spec/fixtures/integration_aggregator/taxes/invoices/failure_response.json')
File.read(path)
end

it 'returns validation error' do
result = execute_graphql(
current_user: membership.user,
current_organization: organization,
permissions: required_permission,
query: mutation,
variables: {
input: {
customerId: customer.id,
currency:,
fees:
}
}
)

response = result['errors'].first['extensions']

aggregate_failures do
expect(response['status']).to eq(422)
expect(response['details']['taxError']).to include('taxDateTooFarInFuture')
end
end
end
end

0 comments on commit 2d9361e

Please sign in to comment.