about summary refs log tree commit diff
path: root/spec/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-10-03 17:50:59 +0200
committerGitHub <noreply@github.com>2019-10-03 17:50:59 +0200
commiteb83d6256e6dc5d9c93dcb2b0a55e1061fee735f (patch)
tree942872aa35182fb748e40a61173ed708f0a983f1 /spec/services
parent9a1be333b8f2a1bb2a25e77053efa16c3e30f068 (diff)
Add `reason` param to `POST /api/v1/accounts` REST API (#12064)
For approval-required registrations mode
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/app_sign_up_service_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/app_sign_up_service_spec.rb b/spec/services/app_sign_up_service_spec.rb
index 7948bb53b..e7c7f3ba1 100644
--- a/spec/services/app_sign_up_service_spec.rb
+++ b/spec/services/app_sign_up_service_spec.rb
@@ -38,6 +38,15 @@ RSpec.describe AppSignUpService, type: :service do
       user = User.find_by(id: access_token.resource_owner_id)
       expect(user).to_not be_nil
       expect(user.account).to_not be_nil
+      expect(user.invite_request).to be_nil
+    end
+
+    it 'creates an account with invite request text' do
+      access_token = subject.call(app, good_params.merge(reason: 'Foo bar'))
+      expect(access_token).to_not be_nil
+      user = User.find_by(id: access_token.resource_owner_id)
+      expect(user).to_not be_nil
+      expect(user.invite_request&.text).to eq 'Foo bar'
     end
   end
 end