A platform for community discussion. Free, open, simple.
DEV: Prefer `update!` over `update` when return value is not checked.
Guo Xiang Tan911d47934a95
diff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rbindex 117c88b7a69..4229bce9fff 100644--- a/spec/requests/topics_controller_spec.rb+++ b/spec/requests/topics_controller_spec.rb@@ -1280,18 +1280,19 @@ RSpec.describe TopicsController dodescribe "when first post is locked" doit "blocks non-staff from editing even if 'trusted_users_can_edit_others' is true" doSiteSetting.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)endit "allows staff to edit" dosign_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"