Files
strike_me-api/spec/strike_me/api/invoice_response_spec.rb
T
2025-09-15 15:55:58 -05:00

21 lines
688 B
Ruby

# frozen_string_literal: true
RSpec.describe StrikeMe::API::InvoiceResponse do
let(:valid_attributes) { { ok: true, checking_id: 'abc1', payment_request: 'abc2', error_message: 'abc3' } }
let(:invalid_attributes) { valid_attributes.merge(ok: false) }
context 'valid response' do
subject { described_class.new(valid_attributes) }
it { is_expected.to be_a StrikeMe::API::BaseModel }
it { is_expected.to be_valid }
it { is_expected.to have_attributes checking_id: 'abc1', payment_request: 'abc2', error_message: 'abc3' }
end
context 'invalid response' do
subject { described_class.new(invalid_attributes) }
it { is_expected.to_not be_valid }
end
end