mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: new site setting show_inactive_accounts
This commit is contained in:
parent
f0ef307d2d
commit
5003f07b2c
7 changed files with 19 additions and 7 deletions
|
@ -44,6 +44,14 @@ describe UsersController do
|
|||
expect(response).not_to be_success
|
||||
end
|
||||
|
||||
it 'returns success when show_inactive_accounts is true and user is logged in' do
|
||||
SiteSetting.show_inactive_accounts = true
|
||||
log_in_user(user)
|
||||
inactive = Fabricate(:user, active: false)
|
||||
get :show, params: { username: inactive.username }, format: :json
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "raises an error on invalid access" do
|
||||
Guardian.any_instance.expects(:can_see?).with(user).returns(false)
|
||||
get :show, params: { username: user.username }, format: :json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue