mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Added ban information to user api
This commit is contained in:
parent
a3356e57d3
commit
f9f4485c95
3 changed files with 51 additions and 19 deletions
|
@ -29,6 +29,25 @@ describe Api::V1::UsersController do
|
|||
get :show, id: -1
|
||||
}.to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
|
||||
it 'returns correct ban if user muted' do
|
||||
create :ban, :mute, user: @user
|
||||
get :show, id: @user.id
|
||||
expect(response).to be_success
|
||||
expect(json['bans']['mute']).to eq(true)
|
||||
end
|
||||
it 'returns correct ban if user gather banned' do
|
||||
create :ban, :gather, user: @user
|
||||
get :show, id: @user.id
|
||||
expect(response).to be_success
|
||||
expect(json['bans']['gather']).to eq(true)
|
||||
end
|
||||
it 'returns correct ban if user site banned' do
|
||||
create :ban, :site, user: @user
|
||||
get :show, id: @user.id
|
||||
expect(response).to be_success
|
||||
expect(json['bans']['site']).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#index' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue