Skip to content

Commit

Permalink
update router for test purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruBurlacu committed Sep 3, 2017
1 parent 9258a03 commit 990bd61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ defmodule ElixirDocker.Router do
end

get "/status" do
last_run = Record |> Ecto.Query.last |> Repo.one
if System.get_env("MIX_ENV") == "test" do
timestamp = Ecto.DateTime.from_date_and_time(%Ecto.Date{year: 2017, month: 09, day: 03},
%Ecto.Time{hour: 12, min: 42, sec: 50, usec: 00})
last_run = %{inserted_at: timestamp, count: 10}
else
last_run = Record |> Ecto.Query.last |> Repo.one
end

conn
|> put_resp_content_type("application/json")
Expand Down

0 comments on commit 990bd61

Please sign in to comment.