Sha256: 2ae3cda5a0bb4d7efe4273e9ac44815f67e3762e0091b1f5dcfbd5e04a449d02

Contents?: true

Size: 309 Bytes

Versions: 15

Compression:

Stored size: 309 Bytes

Contents

FactoryGirl.define do
	factory :post, class: Proclaim::Post do
		sequence(:title) {|n| "title#{n}"}
		sequence(:body) {|n| "body#{n}"}
		association :author, factory: :user

		factory :published_post do
			# Also called upon create
			after(:build) do |post, evaluator|
				post.publish
			end
		end
	end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
proclaim-0.5.3 test/factories/proclaim/post.rb
proclaim-0.5.2 test/factories/proclaim/post.rb
proclaim-0.5.1 test/factories/proclaim/post.rb
proclaim-0.5.0 test/factories/proclaim/post.rb
proclaim-0.4.0 test/factories/proclaim/post.rb
proclaim-0.3.1 test/factories/proclaim/post.rb
proclaim-0.3.0 test/factories/proclaim/post.rb
proclaim-0.2.4 test/factories/proclaim/post.rb
proclaim-0.2.2 test/factories/proclaim/post.rb
proclaim-0.2.1 test/factories/proclaim/post.rb
proclaim-0.2.0 test/factories/proclaim/post.rb
proclaim-0.1.3 test/factories/proclaim/post.rb
proclaim-0.1.2 test/factories/proclaim/post.rb
proclaim-0.1.1 test/factories/proclaim/post.rb
proclaim-0.1.0 test/factories/proclaim/post.rb