Load user and language fixtures for diary model tests

This commit is contained in:
Tom Hughes 2016-10-19 12:17:20 +01:00
parent c83f15821d
commit 6a9b0f05b2
2 changed files with 4 additions and 0 deletions

View file

@ -1,6 +1,8 @@
require "test_helper"
class DiaryCommentTest < ActiveSupport::TestCase
fixtures :users, :languages
test "body must be present" do
comment = build(:diary_comment, :body => "")
assert_not comment.valid?

View file

@ -1,6 +1,8 @@
require "test_helper"
class DiaryEntryTest < ActiveSupport::TestCase
fixtures :users, :languages
def test_diary_entry_validations
diary_entry_valid({})
diary_entry_valid({ :title => "" }, false)