Skip to content

Commit

Permalink
updates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghatighorias committed Oct 24, 2017
1 parent d3127f4 commit 205723f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/course_planner/accounts/user_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,9 @@ defmodule CoursePlanner.UserTest do
refute changeset.errors[:comments]
end

test "changeset is valid when comment is 255 characters" do
changeset = User.changeset(%User{}, %{comments: String.duplicate("a", 255)})
refute changeset.errors[:comments]
end

test "changeset is invalid when comment is bigger than 255 characters" do
changeset = User.changeset(%User{}, %{comments: String.duplicate("a", 256)})
assert changeset.errors[:comments] == {"should be at most %{count} character(s)", [count: 255, validation: :length, max: 255]}
test "changeset is valid for comments bigger than 255 characters" do
changeset = User.changeset(%User{}, %{email: "a@a.com", role: "Student", comments: String.duplicate("a", 256)})
assert assert changeset.valid?
end
end

Expand Down

0 comments on commit 205723f

Please sign in to comment.