mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
Improvements to user drafts (#6226)
* drafts in user profile: only show to user herself (not to admins), use avatar replying to (instead of topic OP), add keyboard shortcut for drafts, simplify display labels * use JSON when testing Draft.stream
This commit is contained in:
@ -2350,24 +2350,6 @@ describe Guardian do
|
||||
end
|
||||
end
|
||||
|
||||
describe "can_see_drafts?" do
|
||||
it "won't allow a non-logged in user to see a user's drafts" do
|
||||
expect(Guardian.new.can_see_drafts?(user)).to be_falsey
|
||||
end
|
||||
|
||||
it "won't allow a user to see another user's drafts" do
|
||||
expect(Guardian.new(coding_horror).can_see_drafts?(user)).to be_falsey
|
||||
end
|
||||
|
||||
it "will allow user to see own drafts" do
|
||||
expect(Guardian.new(user).can_see_drafts?(user)).to be_truthy
|
||||
end
|
||||
|
||||
it "will allow an admin to see a user's drafts" do
|
||||
expect(Guardian.new(admin).can_see_drafts?(user)).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
describe "can_edit_email?" do
|
||||
context 'when allowed in settings' do
|
||||
before do
|
||||
|
Reference in New Issue
Block a user