Commit c05f52ba7641e20caf49a9288ed29bdd4a22762d
1 parent
9b83cde8
Exists in
master
and in
28 other branches
ActionItem277: add test to restrict multiple users with the same e-mail
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1663 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
test/functional/account_controller_test.rb
@@ -246,6 +246,16 @@ class AccountControllerTest < Test::Unit::TestCase | @@ -246,6 +246,16 @@ class AccountControllerTest < Test::Unit::TestCase | ||
246 | assert_no_tag :tag => "body" # e.g. no layout | 246 | assert_no_tag :tag => "body" # e.g. no layout |
247 | end | 247 | end |
248 | 248 | ||
249 | + should 'restrict multiple users with the same e-mail' do | ||
250 | + assert_difference User, :count do | ||
251 | + create_user(:login => 'user1', :email => 'user@example.com') | ||
252 | + assert assigns(:user).valid? | ||
253 | + create_user(:login => 'user2', :email => 'user@example.com') | ||
254 | + assert assigns(:user).errors.on(:email) | ||
255 | + end | ||
256 | + end | ||
257 | + | ||
258 | + | ||
249 | protected | 259 | protected |
250 | def create_user(options = {}) | 260 | def create_user(options = {}) |
251 | post :signup, :user => { :login => 'quire', :email => 'quire@example.com', | 261 | post :signup, :user => { :login => 'quire', :email => 'quire@example.com', |