FIX: Reviewables should not be created for users until they are active

Conversely, if a user is deactivated the reviewable should automatically
be rejected.

Before this fix, if a user was not active they'd still show in the
review queue but without an "Approve" button which was confusing.
This commit is contained in:
Robin Ward
2019-04-03 12:04:05 -04:00
parent 974007a3cc
commit c1ea63bdc1
13 changed files with 82 additions and 17 deletions

View File

@ -71,6 +71,8 @@ RSpec.describe Admin::UsersController do
end
it 'calls approve' do
Jobs.run_immediately!
evil_trout.activate
put "/admin/users/#{evil_trout.id}/approve.json"
expect(response.status).to eq(200)
evil_trout.reload
@ -102,6 +104,8 @@ RSpec.describe Admin::UsersController do
end
it "approves the user when permitted" do
Jobs.run_immediately!
evil_trout.activate
put "/admin/users/approve-bulk.json", params: { users: [evil_trout.id] }
expect(response.status).to eq(200)
evil_trout.reload