Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Jun 7, 2024
1 parent 77e637a commit a604ee1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/alerts/alerts_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule AlertsTest do
describe "diversion?/1" do
test "returns true when created at is before active period" do
created_at = Timex.now()
active_period = [Timex.shift(created_at, days: 1), Timex.shift(created_at, days: 2)]
active_period = [{Timex.shift(created_at, days: 1), Timex.shift(created_at, days: 2)}]

alert =
Factories.Alerts.Alert.build(:alert,
Expand All @@ -127,7 +127,7 @@ defmodule AlertsTest do

test "returns false when created at is after active period" do
created_at = Timex.now()
active_period = [Timex.shift(created_at, days: -2), Timex.shift(created_at, days: -1)]
active_period = [{Timex.shift(created_at, days: -2), Timex.shift(created_at, days: -1)}]

alert =
Factories.Alerts.Alert.build(:alert,
Expand Down
2 changes: 1 addition & 1 deletion test/support/factories/alerts/alert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Test.Support.Factories.Alerts.Alert do
def alert_factory do
%Alert{
id: :rand.uniform(999) |> Integer.to_string(),
active_period: [Faker.DateTime.forward(1), Faker.DateTime.forward(2)],
active_period: [{Faker.DateTime.forward(1), Faker.DateTime.forward(2)}],
banner: Faker.Lorem.Shakespeare.king_richard_iii(),
cause: Faker.Lorem.Shakespeare.king_richard_iii(),
created_at: Timex.now(),
Expand Down

0 comments on commit a604ee1

Please sign in to comment.