mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
DEV: Prefer update!
over update
when return value is not checked.
This commit is contained in:
parent
d745568633
commit
911d47934a
|
@ -1280,18 +1280,19 @@ RSpec.describe TopicsController do
|
|||
describe "when first post is locked" do
|
||||
it "blocks non-staff from editing even if 'trusted_users_can_edit_others' is true" do
|
||||
SiteSetting.trusted_users_can_edit_others = true
|
||||
user.update(trust_level: 3)
|
||||
topic.first_post.update(locked_by_id: admin.id)
|
||||
user.update!(trust_level: 3)
|
||||
topic.first_post.update!(locked_by_id: admin.id)
|
||||
|
||||
put "/t/#{topic.slug}/#{topic.id}.json", params: {
|
||||
title: topic.title + " hello"
|
||||
}
|
||||
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "allows staff to edit" do
|
||||
sign_in(Fabricate(:admin))
|
||||
topic.first_post.update(locked_by_id: admin.id)
|
||||
topic.first_post.update!(locked_by_id: admin.id)
|
||||
|
||||
put "/t/#{topic.slug}/#{topic.id}.json", params: {
|
||||
title: topic.title + " hello"
|
||||
|
|
Loading…
Reference in New Issue
Block a user