Skip to content

Commit

Permalink
Add test for not having minimum teaching days without holidays.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhnonose committed Jun 23, 2017
1 parent 33a1296 commit fca167f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/models/term_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,15 @@ defmodule CoursePlanner.TermTest do
refute changeset.valid?
assert changeset.errors[:minimum_teaching_days] == {"There's not enough minimum teaching days.", []}
end

test "term doesn't have minimum teaching days without holidays" do
{:error, changeset} = Terms.create(%{
"name" => "Spring",
"start_date" => %{day: 17, month: 3, year: 2017},
"end_date" => %{day: 20, month: 3, year: 2017},
"minimum_teaching_days" => 5
})
refute changeset.valid?
assert changeset.errors[:minimum_teaching_days] == {"There's not enough minimum teaching days.", []}
end
end

0 comments on commit fca167f

Please sign in to comment.