Skip to content

Commit

Permalink
fix: tests to work with board slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Aug 26, 2020
1 parent 64e44c2 commit 92aab3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/epoch/board.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule Epoch.Board do
@primary_key {:id, :binary_id, autogenerate: true}
schema "boards" do
field :name, :string
field :slug, :string
field :description, :string
field :post_count, :integer
field :thread_count, :integer
Expand Down
1 change: 1 addition & 0 deletions test/epoch_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ defmodule EpochTest do
def create_board(name \\ "Testing Board") do
%Epoch.Board{
name: name,
slug: :crypto.strong_rand_bytes(5) |> Base.url_encode64 |> binary_part(0, 5),
description: "Testing grounds for discussion",
created_at: NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second),
updated_at: NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
Expand Down
1 change: 1 addition & 0 deletions test/epoch_test/post_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ defmodule EpochTest.PostTest do
test "post" do
b = %Epoch.Board{
name: "Testing Board",
slug: :crypto.strong_rand_bytes(5) |> Base.url_encode64 |> binary_part(0, 5),
description: "Testing grounds for discussion",
created_at: NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second),
updated_at: NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
Expand Down

0 comments on commit 92aab3b

Please sign in to comment.