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.

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