Commit 0820adcf authored by sfang97's avatar sfang97

DRY user 404 test

parent a30a420e
...@@ -2400,7 +2400,9 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do ...@@ -2400,7 +2400,9 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
end end
describe 'POST /users/:id/deactivate' do describe 'POST /users/:id/deactivate' do
subject { post api("/users/#{user.id}/deactivate", api_user) } subject { post api("/users/#{user_id}/deactivate", api_user) }
let(:user_id) { user.id }
context 'performed by a non-admin user' do context 'performed by a non-admin user' do
let(:api_user) { user } let(:api_user) { user }
...@@ -2496,8 +2498,10 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do ...@@ -2496,8 +2498,10 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
end end
context 'for a user that does not exist' do context 'for a user that does not exist' do
let(:user_id) { 0 }
before do before do
post api("/users/0/deactivate", admin) subject
end end
it_behaves_like '404' it_behaves_like '404'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment