about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authorLevi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>2018-04-08 13:43:10 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-04-08 13:43:10 +0200
commitcd0eaa349ca5d7e53e2ed246e70e99fc61c98370 (patch)
tree1d1f099ad6bcb3be4bd6b11343e4d915b623a286 /spec/controllers
parent1364e9e4ae1fb12a1c970795f1d0afd651c7cfe2 (diff)
Enable updating additional account information from user preferences via rest api (#6789)
* Enable updating additional account information from user preferences via rest api
Resolves #6553

* Pacify rubocop

* Decoerce incoming settings in UserSettingsDecorator

* Create user preferences hash directly from incoming credentials instead of going through ActionController::Parameters

* Clean up user preferences update

* Use ActiveModel::Type::Boolean instead of manually checking stringified number equivalence
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/api/v1/accounts/credentials_controller_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb
index 461b8b34b..87fce64eb 100644
--- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb
+++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb
@@ -28,6 +28,10 @@ describe Api::V1::Accounts::CredentialsController do
             note: "Hi!\n\nToot toot!",
             avatar: fixture_file_upload('files/avatar.gif', 'image/gif'),
             header: fixture_file_upload('files/attachment.jpg', 'image/jpeg'),
+            source: {
+              privacy: 'unlisted',
+              sensitive: true,
+            }
           }
         end
 
@@ -42,6 +46,8 @@ describe Api::V1::Accounts::CredentialsController do
           expect(user.account.note).to eq("Hi!\n\nToot toot!")
           expect(user.account.avatar).to exist
           expect(user.account.header).to exist
+          expect(user.setting_default_privacy).to eq('unlisted')
+          expect(user.setting_default_sensitive).to eq(true)
         end
 
         it 'queues up an account update distribution' do