]> git.openstreetmap.org Git - rails.git/blob - test/models/diary_comment_test.rb
Use model relations when creating objects from factories
[rails.git] / test / models / diary_comment_test.rb
1 require "test_helper"
2
3 class DiaryCommentTest < ActiveSupport::TestCase
4   test "body must be present" do
5     comment = build(:diary_comment, :body => "")
6     assert_not comment.valid?
7     assert_not_nil comment.errors[:body], "no validation error for missing body"
8   end
9 end