diff --git a/test/factories/check_logs.rb b/test/factories/check_logs.rb index 669e52e..02828b1 100644 --- a/test/factories/check_logs.rb +++ b/test/factories/check_logs.rb @@ -27,9 +27,9 @@ FactoryBot.define do factory :check_log do check - status :pending - exit_status nil - parsed_response nil - raw_response nil + status { :pending } + exit_status { nil } + parsed_response { nil } + raw_response { nil } end end diff --git a/test/factories/check_notifications.rb b/test/factories/check_notifications.rb index 3167933..8cc2fbb 100644 --- a/test/factories/check_notifications.rb +++ b/test/factories/check_notifications.rb @@ -25,20 +25,20 @@ FactoryBot.define do factory :check_notification do check notification - status :pending - sent_at nil + status { :pending } + sent_at { nil } trait :ongoing do - status :ongoing + status { :ongoing } end trait :succeed do - status :succeed + status { :succeed } sent_at { 1.day.ago } end trait :failed do - status :failed + status { :failed } end end end diff --git a/test/factories/checks.rb b/test/factories/checks.rb index 885ffd2..a0ad5cd 100644 --- a/test/factories/checks.rb +++ b/test/factories/checks.rb @@ -34,54 +34,54 @@ FactoryBot.define do factory :check do user - kind :domain - domain "domain.fr" - domain_created_at Time.new(2016, 4, 1, 12, 0, 0, "+02:00") - domain_updated_at Time.new(2017, 3, 1, 12, 0, 0, "+02:00") - domain_expires_at Time.new(2019, 4, 1, 12, 0, 0, "+02:00") - active true - vendor nil - comment nil - last_run_at nil - last_success_at nil - consecutive_failures 0 - mode :auto + kind { :domain } + domain { "domain.fr" } + domain_created_at { Time.new(2016, 4, 1, 12, 0, 0, "+02:00") } + domain_updated_at { Time.new(2017, 3, 1, 12, 0, 0, "+02:00") } + domain_expires_at { Time.new(2019, 4, 1, 12, 0, 0, "+02:00") } + active { true } + vendor { nil } + comment { nil } + last_run_at { nil } + last_success_at { nil } + consecutive_failures { 0 } + mode { :auto } trait :domain do - kind :domain + kind { :domain } end trait :ssl do - kind :ssl + kind { :ssl } end trait :nil_dates do - domain_created_at nil - domain_updated_at nil - domain_expires_at nil + domain_created_at { nil } + domain_updated_at { nil } + domain_expires_at { nil } end trait :expires_next_week do - domain_expires_at 1.week.from_now + domain_expires_at { 1.week.from_now } end trait :expires_next_year do - domain_expires_at 1.year.from_now + domain_expires_at { 1.year.from_now } end trait :last_runs_failed do - consecutive_failures 5 - last_run_at 3.days.ago - 90.minutes - last_success_at 7.days.ago - 2.hours + consecutive_failures { 5 } + last_run_at { 3.days.ago - 90.minutes } + last_success_at { 7.days.ago - 2.hours } end trait :last_run_succeed do - last_run_at 25.hour.ago - last_success_at 25.hour.ago + last_run_at { 25.hours.ago } + last_success_at { 25.hours.ago } end trait :inactive do - active false + active { false } end end end diff --git a/test/factories/notifications.rb b/test/factories/notifications.rb index 6d5b348..fee11d0 100644 --- a/test/factories/notifications.rb +++ b/test/factories/notifications.rb @@ -29,13 +29,13 @@ FactoryBot.define do factory :notification do user - interval 30 - channel :email + interval { 30 } + channel { :email } sequence(:label) { |n| "#{recipient}-#{n} (#{interval})" } - recipient "recipient@domain.fr" + recipient { "recipient@domain.fr" } trait :email do - channel :email + channel { :email } end end end diff --git a/test/factories/users.rb b/test/factories/users.rb index 2387c3c..0304233 100644 --- a/test/factories/users.rb +++ b/test/factories/users.rb @@ -38,14 +38,14 @@ require "securerandom" FactoryBot.define do factory :user do sequence(:email) { |n| "user-#{n}@chexpire.org" } - password "password" - confirmed_at Time.new(2018, 4, 1, 12, 0, 0, "+02:00") - notifications_enabled true - locale "en" - tos_accepted true + password { "password" } + confirmed_at { Time.new(2018, 4, 1, 12, 0, 0, "+02:00") } + notifications_enabled { true } + locale { "en" } + tos_accepted { true } trait :fr do - locale "fr" + locale { "fr" } end end end