require "test_helper" class CredentialTest < ActiveSupport::TestCase test "email must be present" do @c = Credential.new assert_not @c.save end test "email must be valid" do @c = Credential.new @c.email = "not on your nelly" assert_not @c.save end test "email must be unique" do @c = Credential.new @c.email = "bob@example.net" assert_not @c.save end test "domain added to name" do @c = Credential.new(email: "jez@#{domains(:one).domain}", password: "1234567&ab", domain_id: domains(:one).id) assert @c.save end end