From a8ec73a0307924610023525786bb3a9eb8b173e1 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Jan 2013 15:09:58 +0100 Subject: unit tests passing --- users/test/unit/user_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'users/test/unit/user_test.rb') diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb index 917728b..66563a3 100644 --- a/users/test/unit/user_test.rb +++ b/users/test/unit/user_test.rb @@ -57,4 +57,18 @@ class UserTest < ActiveSupport::TestCase assert @user.is_admin? end + test "login needs to be unique" do + other_user = FactoryGirl.create :user, login: @user.login + assert !@user.valid? + other_user.destroy + end + + test "login needs to be different from other peoples email aliases" do + other_user = FactoryGirl.create :user + other_user.email_aliases.build :email => @user.login + other_user.save + assert !@user.valid? + other_user.destroy + end + end -- cgit v1.2.3