Commit d14eec8cea54e7966e3fdfadabf5ae102e342113

Authored by Leandro Santos
1 parent 1ed260f3

fix unit tests of api

Showing 1 changed file with 2 additions and 0 deletions   Show diff stats
test/unit/api/session_test.rb
@@ -173,6 +173,7 @@ class SessionTest < ActiveSupport::TestCase @@ -173,6 +173,7 @@ class SessionTest < ActiveSupport::TestCase
173 173
174 should 'change user password and close task' do 174 should 'change user password and close task' do
175 user = create_user 175 user = create_user
  176 + user.activate
176 task = ChangePassword.create!(:requestor => user.person) 177 task = ChangePassword.create!(:requestor => user.person)
177 params = {:code => task.code, :password => 'secret', :password_confirmation => 'secret'} 178 params = {:code => task.code, :password => 'secret', :password_confirmation => 'secret'}
178 patch "/api/v1/new_password?#{params.to_query}" 179 patch "/api/v1/new_password?#{params.to_query}"
@@ -184,6 +185,7 @@ class SessionTest < ActiveSupport::TestCase @@ -184,6 +185,7 @@ class SessionTest < ActiveSupport::TestCase
184 185
185 should 'do not change user password when password confirmation is wrong' do 186 should 'do not change user password when password confirmation is wrong' do
186 user = create_user 187 user = create_user
  188 + user.activate
187 task = ChangePassword.create!(:requestor => user.person) 189 task = ChangePassword.create!(:requestor => user.person)
188 params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'} 190 params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'}
189 patch "/api/v1/new_password?#{params.to_query}" 191 patch "/api/v1/new_password?#{params.to_query}"