JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Blows up on 2.0.4 #20

Closed itsbagpack closed 10 years ago

itsbagpack commented 10 years ago
require 'factory_girl'

class Post
  attr_accessor :title, :description
  def save!
  end
end

# main factory
FactoryGirl.define do
  factory :post do
    title "some title"
    self
    method(:factory).source_location
  end
end

# use modify to add the trait
FactoryGirl.modify do
  factory :post do
    trait :with_desc do
      description "some desc"
    end
    method(:factory).source_location
    factory :described_post, traits: [:with_desc]
  end
end

FactoryGirl.create :post, :with_desc
FactoryGirl.create :described_post