acts_as_chargeable_spec.rb 1.14 KB
require 'spec_helper'

describe ActsAsChargeable do
  context 'as a module' do
    it 'can be implemented in ActiveRecord' do
      expect(Product).to respond_to(:acts_as_chargeable)
    end
  end
end

# Tests for mock on Chargeable class
describe Product do
  it { is_expected.to respond_to(:charge_with) }
  it { is_expected.to respond_to(:charge_with_conekta) }
  it { is_expected.to respond_to(:conekta_charge) }
  it { is_expected.to respond_to(:conekta_type_of_charge) }
  it { is_expected.to respond_to(:update_conekta_barcode) }
  it { is_expected.to respond_to(:manual_charge) }
  it { is_expected.to respond_to(:manual_discharge) }
  it { is_expected.to respond_to(:find_charge) }
  it { is_expected.to respond_to(:charged?) }
  it { is_expected.to respond_to(:find_conekta_charge) }
  it { is_expected.to respond_to(:instance_support?) }
  it { is_expected.to respond_to(:sync) }
  it { is_expected.to respond_to(:conekta_attributes) }
  it { is_expected.to respond_to(:paypal_attributes) }
  it { is_expected.to respond_to(:var_payed?) }
  it { is_expected.to respond_to(:cancel_oxxo_payment) }
  it { is_expected.to respond_to(:var_expired_by) }
end