Sha256: 80dcaf05fb4185cad9bee1b7697069d562828da2c0973752827368a9a13ab121

Contents?: true

Size: 626 Bytes

Versions: 5

Compression:

Stored size: 626 Bytes

Contents

FactoryGirl.define do
  factory :contract, :class => FinePrint::Contract do
    name { "Contract_#{SecureRandom.hex(4)}" }
    title { Faker::Lorem.sentence(3) }
    content { Faker::Lorem.paragraphs(2) }

    factory :published_contract do
      after(:create) {|instance| instance.publish }
    end

    factory :signed_contract do
      after(:build) {|instance| instance.save; instance.publish }

      ignore do
        count 2
      end

      after(:build) do |contract, evaluator|
        evaluator.count.times do 
          contract.signatures << FactoryGirl.build(:signature)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fine_print-1.3.0 spec/factories/contract.rb
fine_print-1.2.0 spec/factories/contract.rb
fine_print-1.1.1 spec/factories/contract.rb
fine_print-1.1.0 spec/factories/contract.rb
fine_print-1.0.0 spec/factories/contract.rb