2020-05-14 17:21:51 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Super Admin Account Users API', type: :request do
|
|
|
|
let(:super_admin) { create(:super_admin) }
|
|
|
|
|
2020-05-24 17:14:26 +00:00
|
|
|
describe 'GET /super_admin/account_users/new' do
|
2020-05-14 17:21:51 +00:00
|
|
|
context 'when it is an unauthenticated super admin' do
|
|
|
|
it 'returns unauthorized' do
|
2020-05-24 17:14:26 +00:00
|
|
|
get '/super_admin/account_users/new'
|
2020-05-14 17:21:51 +00:00
|
|
|
expect(response).to have_http_status(:redirect)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when it is an authenticated super admin' do
|
2020-05-24 17:14:26 +00:00
|
|
|
it 'shows the account user create page' do
|
2020-05-14 17:21:51 +00:00
|
|
|
sign_in super_admin
|
2020-05-24 17:14:26 +00:00
|
|
|
get '/super_admin/account_users/new'
|
2020-05-14 17:21:51 +00:00
|
|
|
expect(response).to have_http_status(:success)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|