diff options
author | azul <azul@riseup.net> | 2017-11-16 04:58:10 -0800 |
---|---|---|
committer | azul <azul@riseup.net> | 2017-11-16 04:58:10 -0800 |
commit | 66ad2c7bd477b7d3f887aeede8963b1ec9d4c479 (patch) | |
tree | c911f020eb11d0e1342c96ae225cf2a4a6ca57df /test/integration/api/pgp_key_test.rb | |
parent | f250a11b4fd98bb9f4ef50c501b72f5ae2a97d1d (diff) | |
parent | 1ce9a3355ee59181df0359ebb455efa9ef323bb6 (diff) |
Merge branch 'fix/8798-key-errors' into 'master'
Fix/8798 key errors
Closes #8798
See merge request leap/webapp!54
Diffstat (limited to 'test/integration/api/pgp_key_test.rb')
-rw-r--r-- | test/integration/api/pgp_key_test.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/integration/api/pgp_key_test.rb b/test/integration/api/pgp_key_test.rb index 4c7fb4c..f2744e1 100644 --- a/test/integration/api/pgp_key_test.rb +++ b/test/integration/api/pgp_key_test.rb @@ -14,16 +14,16 @@ class PgpKeyTest < SrpTest assert_equal key, Identity.for(@user).keys[:pgp] end - # eventually probably want to remove most of this into a non-integration - # functional test test "prevent uploading invalid key" do update_user public_key: "invalid key" + assert_invalid_key_response assert_nil Identity.for(@user).keys[:pgp] end test "prevent emptying public key" do update_user public_key: key update_user public_key: "" + assert_invalid_key_response assert_equal key, Identity.for(@user).keys[:pgp] end @@ -32,4 +32,9 @@ class PgpKeyTest < SrpTest def key @key ||= FactoryGirl.build :pgp_key end + + def assert_invalid_key_response + assert_response :unprocessable_entity + assert_json_error "public_key_block"=>["does not look like an armored pgp public key block"] + end end |