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:
Penar Musaraj
2018-08-01 17:41:27 -04:00
committed by Sam
parent 8147130412
commit 4a872823e7
12 changed files with 34 additions and 54 deletions

View File

@ -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