API de comptabilité horaire.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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