Commit 2066e85954c9f8892d0fb932598e35c33dceb727
1 parent
f57a77f8
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Removed custom duplicate field validation
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
lib/noosfero/api/session.rb
... | ... | @@ -37,7 +37,6 @@ module Noosfero |
37 | 37 | requires :password_confirmation, type: String, desc: _("Password confirmation") |
38 | 38 | end |
39 | 39 | post "/register" do |
40 | - unique_attributes! User, [:email, :login] | |
41 | 40 | attrs = attributes_for_keys [:email, :login, :password, :password_confirmation] + environment.signup_person_fields |
42 | 41 | remote_ip = (request.respond_to?(:remote_ip) && request.remote_ip) || (env && env['REMOTE_ADDR']) |
43 | 42 | ... | ... |
test/unit/api/session_test.rb
... | ... | @@ -32,11 +32,13 @@ class SessionTest < ActiveSupport::TestCase |
32 | 32 | assert_equal 400, last_response.status |
33 | 33 | end |
34 | 34 | |
35 | - should 'do not register a duplicated user' do | |
35 | + should 'not register a duplicated user' do | |
36 | 36 | params = {:login => "newuserapi", :password => "newuserapi", :password_confirmation => "newuserapi", :email => "newuserapi@email.com" } |
37 | 37 | post "/api/v1/register?#{params.to_query}" |
38 | 38 | post "/api/v1/register?#{params.to_query}" |
39 | 39 | assert_equal 400, last_response.status |
40 | + json = JSON.parse(last_response.body) | |
41 | + print "JSon: #{json}\n" | |
40 | 42 | end |
41 | 43 | |
42 | 44 | end | ... | ... |