test/factories.rb in mail_engine-0.0.1 vs test/factories.rb in mail_engine-0.1.0

- old
+ new

@@ -5,11 +5,11 @@ lastname "He" end factory :footer_partial, :class => MailEngine::TemplatePartial do |t| placeholder_name "footer" - association :partial_id, :factory => :partial_template + association :partial, :factory => :partial_template end factory :partial_template, :class => MailEngine::MailTemplate do |t| name "New Job" path "user_mailer/notify" @@ -20,36 +20,53 @@ end factory :zip_mail_template_with_footer, :class => MailEngine::MailTemplate do |t| name "New Job" path "user_mailer/notify" + subject "mail template title" # format "html" # can't set format locale "en" handler "liquid" layout "only_footer" partial false for_marketing false zip_file File.open(File.join(Rails.root, '../..', 'test', 'fixtures', 'files', 'compress_by_file.zip')) create_by_upload true - template_partials { [FactoryGirl.build(:footer_partial)] } + template_partials { [FactoryGirl.create(:footer_partial)] } end factory :system_mail_template, :class => MailEngine::MailTemplate do |t| name "New Job" path "user_mailer/notify" + subject "mail template title" # format "html" # can't set format locale "en" handler "liquid" body "latest jobs mail." layout "none" partial false for_marketing false end + factory :system_mail_template_with_footer, :class => MailEngine::MailTemplate do |t| + name "New Job" + path "user_mailer/notify" + subject "mail template title" + # format "html" # can't set format + locale "en" + handler "liquid" + body "latest jobs mail." + layout "only_footer" + partial false + for_marketing false + template_partials { [FactoryGirl.create(:footer_partial)] } + end + factory :dirzip_mail_template, :class => MailEngine::MailTemplate do |t| name "New Job" path "user_mailer/notify" + subject "mail template title" # format "html" # can't set format locale "en" handler "liquid" layout "none" partial false @@ -59,26 +76,36 @@ end factory :filezip_mail_template, :class => MailEngine::MailTemplate do |t| name "New Job" path "user_mailer/notify" + subject "mail template title" # format "html" # can't set format locale "en" handler "liquid" layout "none" partial false for_marketing false zip_file File.open(File.join(Rails.root, '../..', 'test', 'fixtures', 'files', 'compress_by_file.zip')) create_by_upload true end - factory :marketing_mail_template, :parent => :system_mail_template do |t| + factory :marketing_mail_template, :class => MailEngine::MailTemplate do |t| + name "New Job Newsletter" + path "new_jobs" + subject "new job mail title" + # format "html" # can't set format + locale "en" + handler "liquid" + body "latest jobs mail." + layout "none" + partial false for_marketing true end factory :mail_schedule, :class => MailEngine::MailSchedule do name "New Data" - association :mail_template, :factory => :system_mail_template, :format => "html" + association :mail_template, :factory => :marketing_mail_template, :format => "html" user_group "all" count 0 sent_count 0 period "daily" payload "firstname,lastname" \ No newline at end of file