summaryrefslogtreecommitdiff
path: root/users/test/integration
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-19 16:02:02 +0200
committerAzul <azul@leap.se>2013-07-24 10:56:45 +0200
commitd70c5796a2989b7b43f7e287899fb1394ae28280 (patch)
treedaeabe5bdcc2386a201d88d838b4b1e387dd9ee3 /users/test/integration
parentc0527cc18788fc60180d9293a546c93e6a77b788 (diff)
separate signup and settings service objects for user
Diffstat (limited to 'users/test/integration')
-rw-r--r--users/test/integration/api/account_flow_test.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/users/test/integration/api/account_flow_test.rb b/users/test/integration/api/account_flow_test.rb
index 93b6507..c09dcb6 100644
--- a/users/test/integration/api/account_flow_test.rb
+++ b/users/test/integration/api/account_flow_test.rb
@@ -84,20 +84,17 @@ class AccountFlowTest < RackTest
identity.destroy
end
put "http://api.lvh.me:3000/1/users/" + @user.id + '.json', :user => {:public_key => test_public_key, :login => new_login}, :format => :json
- @user.reload
assert last_response.successful?
- assert_equal test_public_key, @user.public_key
- assert_equal new_login, @user.login
+ assert_equal test_public_key, Identity.for(@user).keys[:pgp]
+ # does not change login if no password_verifier is present
+ assert_equal original_login, @user.login
# eventually probably want to remove most of this into a non-integration functional test
# should not overwrite public key:
put "http://api.lvh.me:3000/1/users/" + @user.id + '.json', :user => {:blee => :blah}, :format => :json
- @user.reload
- assert_equal test_public_key, @user.public_key
+ assert_equal test_public_key, Identity.for(@user).keys[:pgp]
# should overwrite public key:
put "http://api.lvh.me:3000/1/users/" + @user.id + '.json', :user => {:public_key => nil}, :format => :json
- # TODO: not sure why i need this, but when public key is removed, the DB is updated but @user.reload doesn't seem to actually reload.
- @user = User.find(@user.id) # @user.reload
- assert_nil @user.public_key
+ assert_nil Identity.for(@user).keys[:pgp]
end
end