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.

user_test.rb 861B

12345678910111213141516171819202122232425
  1. require "test_helper"
  2. class UserTest < ActiveSupport::TestCase
  3. test 'user with a valid email should be valid' do
  4. user = User.new(email: "test@test.com", username: "UserTest", password_digest: 'password')
  5. assert user.valid?
  6. end
  7. test 'user with taken username should be invalid' do
  8. other_user = users(:one)
  9. user = User.new(email: "test@email.com", username: other_user.username, password_digest: "test_password")
  10. assert_not user.valid?
  11. end
  12. test 'user with invalid email should be invalid' do
  13. user = User.new(email: "test_invalid_email", username: "UserTest", password_digest: "test_password")
  14. assert_not user.valid?
  15. end
  16. test 'user with taken email should be invalid' do
  17. other_user = users(:one)
  18. user = User.new(email: other_user.email, username: "UserTest", password_digest: "test_password")
  19. assert_not user.valid?
  20. end
  21. end