API de comptabilité horaire.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

task_test.rb 458B

123456789101112131415161718
  1. require "test_helper"
  2. class TaskTest < ActiveSupport::TestCase
  3. setup do
  4. @user = users(:one)
  5. @activity = activities(:one)
  6. end
  7. test "task should be valid" do
  8. task = Task.new(name: "Write", description: "Write a new line", user_id: @user.id, activity_id: @activity.id)
  9. assert task.valid?
  10. end
  11. test "task should not be valid" do
  12. task = Task.new(name: "Write", description: "Write a new line")
  13. assert_not task.valid?
  14. end
  15. end