API de comptabilité horaire.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

activity_test.rb 846B

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