Skip to content

Commit

Permalink
add test chat checks all quotes have author and text property #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Oct 14, 2019
1 parent 38bd7c1 commit fdf3d44
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/quotes_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ defmodule QuotesTest do
assert sample == found # sample quote was found in the list
end

test "all quotes have author and text property" do
Quotes.parse_json()
|> Enum.each(fn(q) ->
assert Map.has_key?(q, "author")
assert Map.has_key?(q, "text")
assert String.length(q["author"]) > 2 # see: https://git.io/Je8CO
assert String.length(q["text"]) > 10
end)
end



end

0 comments on commit fdf3d44

Please sign in to comment.