Sha256: 19d38c77985a9d7256574d08fd7928277182cbafcc7b5dfd9de0a4ba1b236b6a

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

include ActionDispatch::TestProcess

Factory.define :user, :class => Adminpanel::User do |user|
	user.name "test user"
	user.email "email@test.com"
	user.password "123456"
	user.password_confirmation "123456"
	user.group_id '1'
end

Factory.define :group, :class => Adminpanel::Group do |group|
	group.name 'Admin'
end

Factory.define :gallery, :class => Adminpanel::Gallery do |gallery|
	gallery.file { fixture_file_upload(Rails.root.join('app', 'assets', 'images', 'hipster.jpg'), 'image/jpeg') }
end

Factory.define :image_section, :class => Adminpanel::Image do |image|
	image.file { fixture_file_upload(Rails.root.join('app', 'assets', 'images', 'hipster.jpg'), 'image/jpeg') }
end

Factory.define :product, :class => Adminpanel::Product do |product|
	product.price "12392.2"
	product.name "very little description"
	product.description "this is a little longer description, can be very long"
end

Factory.define :category, :class => Adminpanel::Category do |category|
	category.name "Test Category"
	category.model "Product"
end

Factory.define :photo, :class => Adminpanel::Photo do |photo|
	photo.file { fixture_file_upload(Rails.root.join('app', 'assets', 'images', 'hipster.jpg'), 'image/jpeg') }
end

Factory.define :section_with_gallery, :class => Adminpanel::Section do |section|
	section.key "key"
	# section.description "<p>description</p>"
	section.has_image true
	section.has_description false
	section.name "section_name"
	section.page "index"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adminpanel-1.2.12 spec/support/define_factory_models.rb
adminpanel-1.2.11 spec/support/define_factory_models.rb
adminpanel-1.2.10 spec/support/define_factory_models.rb