Sha256: 4b2d24b224e70bcdc1f6a19bd18e22470a4e498e8cc0502dbaf87d757158bba8

Contents?: true

Size: 636 Bytes

Versions: 11

Compression:

Stored size: 636 Bytes

Contents

require 'workarea/testing/factories'

module Workarea
  module Factories
    module GiftCards
      def create_gift_card(overrides = {})
        attributes = {
          to: 'bcrouse@workarea.com',
          amount: 10.to_m
        }.merge(overrides)

        Workarea::Payment::GiftCard.create!(attributes)
      end

      def create_gift_card_redemption(overrides = {})
        attributes = {
          amount: 10.to_m,
          redeemed_at: Time.now
        }.merge(overrides)

        Workarea::Payment::GiftCard::Redemption.create!(attributes)
      end
    end
  end
end

Workarea::Factories.add(Workarea::Factories::GiftCards)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
workarea-gift_cards-3.4.11 test/factories/gift_cards.rb
workarea-gift_cards-4.0.3 test/factories/gift_cards.rb
workarea-gift_cards-4.0.2 test/factories/gift_cards.rb
workarea-gift_cards-3.4.10 test/factories/gift_cards.rb
workarea-gift_cards-4.0.1 test/factories/gift_cards.rb
workarea-gift_cards-3.4.9 test/factories/gift_cards.rb
workarea-gift_cards-3.4.8 test/factories/gift_cards.rb
workarea-gift_cards-4.0.0 test/factories/gift_cards.rb
workarea-gift_cards-4.0.0.beta.1 test/factories/gift_cards.rb
workarea-gift_cards-3.4.7 test/factories/gift_cards.rb
workarea-gift_cards-3.4.6 test/factories/gift_cards.rb