feat: Ability for the logged in user to create a new account (#985)
Co-authored-by: Divyesh <dkothari@box8.in> Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
@@ -15,9 +15,9 @@ RSpec.describe 'Accounts API', type: :request do
|
||||
end
|
||||
|
||||
it 'calls account builder' do
|
||||
allow(account_builder).to receive(:perform).and_return(user)
|
||||
allow(account_builder).to receive(:perform).and_return([user, account])
|
||||
|
||||
params = { account_name: 'test', email: email }
|
||||
params = { account_name: 'test', email: email, user: nil }
|
||||
|
||||
post api_v1_accounts_url,
|
||||
params: params,
|
||||
@@ -31,7 +31,7 @@ RSpec.describe 'Accounts API', type: :request do
|
||||
it 'renders error response on invalid params' do
|
||||
allow(account_builder).to receive(:perform).and_return(nil)
|
||||
|
||||
params = { account_name: nil, email: nil }
|
||||
params = { account_name: nil, email: nil, user: nil }
|
||||
|
||||
post api_v1_accounts_url,
|
||||
params: params,
|
||||
@@ -46,7 +46,7 @@ RSpec.describe 'Accounts API', type: :request do
|
||||
it 'ignores confirmed param when called with out super admin token' do
|
||||
allow(account_builder).to receive(:perform).and_return(nil)
|
||||
|
||||
params = { account_name: 'test', email: email, confirmed: true }
|
||||
params = { account_name: 'test', email: email, confirmed: true, user: nil }
|
||||
|
||||
post api_v1_accounts_url,
|
||||
params: params,
|
||||
|
||||
Reference in New Issue
Block a user