mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
add test to ensure that userA cannot see drafts stream of userB
This commit is contained in:
parent
38668818a5
commit
3a00c2adeb
@ -24,4 +24,15 @@ describe DraftsController do
|
|||||||
parsed = JSON.parse(response.body)
|
parsed = JSON.parse(response.body)
|
||||||
expect(parsed["drafts"].length).to eq(0)
|
expect(parsed["drafts"].length).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not let userA see drafts by userB' do
|
||||||
|
userB = Fabricate(:user)
|
||||||
|
Draft.set(userB, 'xxx', 0, '{}')
|
||||||
|
|
||||||
|
userA = sign_in(Fabricate(:user))
|
||||||
|
get "/drafts.json", params: { username: userB.username }
|
||||||
|
expect(response.status).to eq(200)
|
||||||
|
parsed = JSON.parse(response.body)
|
||||||
|
expect(parsed["drafts"].length).to eq(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user