API de comptabilité horaire.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920
  1. require "test_helper"
  2. class ActivityTest < ActiveSupport::TestCase
  3. test "activity's author should exist" do
  4. user = User.new(email: "test@test.com", username: "UserTest", password_digest: '$6$12$password')
  5. activity = Activity.new(name: "Pyheatpump", description: "A software to control heat pumps", author: user)
  6. assert activity.valid?
  7. end
  8. test "not valid if name does not exist" do
  9. user = User.new(email: "test@test.com", username: "UserTest", password_digest: '$6$12$password')
  10. activity = Activity.new(description: "A software to control heat pumps", author: user)
  11. assert_not activity.valid?
  12. end
  13. test "not valid if author does not exist" do
  14. activity = Activity.new(name: "Pyheatpump", description: "A software to control heat pumps", author: User.find_by_id(666))
  15. assert_not activity.valid?
  16. end
  17. end