Sha256: 02fc5717e1194c595e8b51e0dec6705bac420dec20766dd1c427bc6a0853ed64

Contents?: true

Size: 959 Bytes

Versions: 2

Compression:

Stored size: 959 Bytes

Contents

FactoryGirl.define do
  
  factory :unpublished_promotion, class: Dhatu::Promotion do
    title "Offer Title"
    code "108273"
    short_description "Some Promotion Description"

    display_name true
    display_email true
    display_phone true

    name_mandatory true
    email_mandatory false
    phone_mandatory false
  end

  factory :published_promotion, parent: :unpublished_promotion do
    after :build do |e|
      e.publish
    end
  end

  factory :removed_promotion, parent: :unpublished_promotion do
    after :build do |e|
      e.remove
    end
  end

  factory :archived_promotion, parent: :unpublished_promotion do
    after :build do |e|
      e.archive
    end
  end

  factory :featured_promotion, parent: :published_promotion do
    after :build do |e|
      e.mark_as_featured
    end
  end

  factory :non_featured_promotion, parent: :published_promotion do
    after :build do |e|
      e.remove_from_featured
    end
  end

  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dhatu-0.1.13 spec/dummy/spec/factories/promotion.rb
dhatu-0.1.12 spec/dummy/spec/factories/promotion.rb