change to renamed caxlsx_rails gem

parent 07d07c20
......@@ -8,7 +8,7 @@ FactoryBot.define do
trait :active_this_year do
period_start { Time.zone.today.beginning_of_year + 1 }
period_end nil
period_end { nil }
end
trait :active_last_year do
......@@ -18,7 +18,7 @@ FactoryBot.define do
trait :active do
period_start { 10.days.ago }
period_end nil
period_end { nil }
end
trait :inactive do
......@@ -40,6 +40,7 @@ FactoryBot.define do
termination_submitted_at { 3.days.ago }
termination_verified_at { 2.days.ago }
association :period_end_set_by, factory: :user
after(:build) do |assignment|
assignment.volunteer ||= create(:volunteer)
assignment.termination_submitted_by = assignment.volunteer.user
......
......@@ -4,7 +4,7 @@ FactoryBot.define do
"the demonstration rar ra ra body_#{n}"
end
user
active true
active { true }
trait :faker_text do
body { FFaker::Lorem.paragraph }
......
......@@ -25,12 +25,12 @@ FactoryBot.define do
end
trait :fake_availability do
flexible [true, false].sample
morning [true, false].sample
afternoon [true, false].sample
evening [true, false].sample
workday [true, false].sample
weekend [true, false].sample
flexible { [true, false].sample }
morning { [true, false].sample }
afternoon { [true, false].sample }
evening { [true, false].sample }
workday { [true, false].sample }
weekend { [true, false].sample }
end
trait :with_language_skills do
......@@ -72,7 +72,7 @@ FactoryBot.define do
end
end
factory :client_common, traits: %i[faker_common with_language_skills fake_availability with_relatives zuerich]
factory :client_common, traits: [:faker_common, :with_language_skills, :fake_availability, :with_relatives, :zuerich]
factory :client_z, traits: [:zuerich]
factory(
:client_seed,
......
......@@ -21,7 +21,7 @@ FactoryBot.define do
end
trait :zuerich do
city 'Zürich'
city { 'Zürich' }
postal_code { Client.zuerich_zips.sample }
end
......
......@@ -7,10 +7,10 @@ FactoryBot.define do
sequence :body do |n|
"the demonstration rar ra ra body_#{n}"
end
active true
active { true }
trait :signup do
subject '%{Anrede} %{Name}'
subject { '%{Anrede} %{Name}' }
body do
"%{Anrede} %{Name}\r\n\r\n#{FFaker::Lorem.paragraph}"
end
......@@ -22,7 +22,7 @@ FactoryBot.define do
"%{Anrede} %{Name}\r\n\r\n#{FFaker::Lorem.paragraph}\r\n\r\n%{Einsatz} %{EinsatzStart} "\
'%{FeedbackLink}'
end
subject '%{Anrede} %{Name}'
subject { '%{Anrede} %{Name}' }
end
trait :termination do
......@@ -30,7 +30,7 @@ FactoryBot.define do
body do
"%{Anrede} %{Name}\r\n\r\n#{FFaker::Lorem.paragraph}\r\n\r\n"
end
subject '%{Anrede} %{Name}'
subject { '%{Anrede} %{Name}' }
end
factory :email_template_signup, traits: [:signup]
......
FactoryBot.define do
factory :event_volunteer do
association :creator, factory: :user
association :volunteer, active: true
......
FactoryBot.define do
factory :event do
kind 0
kind { :intro_course }
title { FFaker::Lorem.sentence }
description { FFaker::Lorem.paragraph }
start_time { FFaker::Time.between(20.hours.ago, 4.hours.ago) }
......
FactoryBot.define do
factory :group_offer_category do
category_name { FFaker::Skill.unique.specialty }
category_state 'active'
category_state { 'active' }
end
end
......@@ -4,8 +4,8 @@ FactoryBot.define do
association :department
title { FFaker::Lorem.unique.sentence }
necessary_volunteers 5
offer_type :internal_offer
necessary_volunteers { 5 }
offer_type { :internal_offer }
comments { FFaker::CheesyLingo.paragraph }
after(:build) do |group_offer|
......@@ -17,8 +17,8 @@ FactoryBot.define do
end
trait :external do
offer_type :external_offer
department nil
offer_type { :external_offer }
department { nil }
location { FFaker::Address.city }
organization { FFaker::Company.name }
end
......
FactoryBot.define do
factory :hour do
meeting_date { FFaker::Time.between(300.days.ago, 10.days.ago) }
hours 2.0
hours { 2.0 }
association :hourable, factory: :assignment
activity { FFaker::CheesyLingo.sentence }
comments { FFaker::CheesyLingo.paragraph }
......
FactoryBot.define do
factory :import do
access_id 2412
base_origin_entity 'tbl_Personenrollen'
access_id { 2412 }
base_origin_entity { 'tbl_Personenrollen' }
store { YAML.parse_file('test/factories/volunteers_import_store.yml').to_ruby }
end
end
FactoryBot.define do
factory :language_skill do
language { I18n.t('language_names').keys.sample }
level 'fluent'
level { 'fluent' }
end
end
FactoryBot.define do
factory :profile do
flexible false
morning false
afternoon false
evening true
workday true
weekend false
flexible { false }
morning { false }
afternoon { false }
evening { true }
workday { true }
weekend { false }
contact
association :user, profile: nil
......
FactoryBot.define do
factory :semester_feedback do
semester_process_volunteer
goals 'Goals text'
achievements 'Achievements text'
future 'Future text'
comments 'Comments text'
goals { 'Goals text' }
achievements { 'Achievements text' }
future { 'Future text' }
comments { 'Comments text' }
transient do
add_mission { true }
......@@ -24,7 +24,7 @@ FactoryBot.define do
association :group_assignment
end
after(:build) do |sem_fb, evl|
after(:build) do |sem_fb, _evl|
if sem_fb.assignment.blank?
sem_fb.group_assignment ||= FactoryBot.build(:group_assignment, volunteer: sem_fb.volunteer)
end
......
......@@ -2,12 +2,12 @@ FactoryBot.define do
factory :semester_process_mail do
semester_process_volunteer
sent_at { Time.zone.local(2018, 8, 12) }
subject 'mail subject'
body 'Mail body'
kind 'mail'
subject { 'mail subject' }
body { 'Mail body' }
kind { 'mail' }
trait :as_reminder do
kind 'reminder'
kind { 'reminder' }
end
after(:build) do |sem_proc_mail|
......
......@@ -17,7 +17,7 @@ FactoryBot.define do
after(:build) do |spvm|
if spvm.assignment.blank?
spvm.group_assignment ||= FactoryBot.build(:group_assignment,
volunteer: spvm.semester_process_volunteer.volunteer)
volunteer: spvm.semester_process_volunteer.volunteer)
end
end
......
FactoryBot.define do
factory :semester_process do
association :creator, factory: :user
mail_subject_template 'mail subject template'
mail_body_template 'mail body template'
mail_subject_template { 'mail subject template' }
mail_body_template { 'mail body template' }
sequence(:semester) { |n| Time.zone.local(2017 + n, 12, 1).beginning_of_day..Time.zone.local(2018 + n, 5, 30).end_of_month }
transient do
......
......@@ -10,7 +10,7 @@ FactoryBot.define do
]
end
sequence :email do |n|
sequence :email do |_n|
'email_%s@example.com' % [SecureRandom.uuid]
end
end
......@@ -13,7 +13,7 @@ FactoryBot.define do
end
after :build do |trial_period|
trial_period.trial_period_mission = create(:assignment) unless trial_period.trial_period_mission.present?
trial_period.trial_period_mission = create(:assignment) if trial_period.trial_period_mission.blank?
end
end
end
FactoryBot.define do
factory :user do
email { FFaker::Internet.unique.email }
password 'asdfasdf'
role User::SUPERADMIN
password { 'asdfasdf' }
role { User::SUPERADMIN }
last_sign_in_at { 15.hours.ago }
active { true }
......@@ -13,19 +13,19 @@ FactoryBot.define do
end
trait :superadmin do
role User::SUPERADMIN
role { User::SUPERADMIN }
end
trait :social_worker do
role User::SOCIAL_WORKER
role { User::SOCIAL_WORKER }
end
trait :volunteer do
role User::VOLUNTEER
role { User::VOLUNTEER }
end
trait :department_manager do
role User::DEPARTMENT_MANAGER
role { User::DEPARTMENT_MANAGER }
end
trait :with_clients do
......
......@@ -3,7 +3,7 @@ FactoryBot.define do
birth_year { FFaker::Time.between(18.years.ago, 85.years.ago) }
contact
salutation { ['mr', 'mrs'].sample }
acceptance :accepted
acceptance { :accepted }
group_offer_categories { |category| [category.association(:group_offer_category)] }
iban { generate :iban }
association :registrar, factory: :user
......@@ -75,7 +75,7 @@ FactoryBot.define do
end
trait :imported do
acceptance :invited
acceptance { :invited }
import
end
......@@ -103,7 +103,7 @@ FactoryBot.define do
factory :volunteer_external, traits: [:external]
factory :volunteer_internal, traits: [:internal]
factory :volunteer_common, traits: %i[internal with_language_skills faker_extra zuerich]
factory :volunteer_common, traits: [:internal, :with_language_skills, :faker_extra, :zuerich]
factory :volunteer_z, traits: [:zuerich]
factory(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment