From 657afe0ffee7f9121f8c4f9e5049d45778851360 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Tue, 20 Jan 2026 23:38:54 -0800 Subject: [PATCH] test(reports): avoid update_column in specs --- spec/builders/v2/report_builder_spec.rb | 4 ++-- .../v2/reports/label_summary_builder_spec.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/builders/v2/report_builder_spec.rb b/spec/builders/v2/report_builder_spec.rb index 1308e4c07..ae9859f4e 100644 --- a/spec/builders/v2/report_builder_spec.rb +++ b/spec/builders/v2/report_builder_spec.rb @@ -24,7 +24,7 @@ describe V2::ReportBuilder do inbox: inbox, created_at: Time.zone.today) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) create_list(:message, 5, message_type: 'outgoing', account: account, inbox: inbox, conversation: conversation, created_at: Time.zone.today + 2.hours) @@ -42,7 +42,7 @@ describe V2::ReportBuilder do inbox: inbox, created_at: (Time.zone.today - 2.days)) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) create_list(:message, 3, message_type: 'outgoing', account: account, inbox: inbox, conversation: conversation, diff --git a/spec/builders/v2/reports/label_summary_builder_spec.rb b/spec/builders/v2/reports/label_summary_builder_spec.rb index f32382802..f6e2df785 100644 --- a/spec/builders/v2/reports/label_summary_builder_spec.rb +++ b/spec/builders/v2/reports/label_summary_builder_spec.rb @@ -95,7 +95,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: Time.zone.today) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) create_list(:message, 2, message_type: 'outgoing', account: account, inbox: inbox, conversation: conversation, @@ -115,7 +115,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: Time.zone.today) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) create_list(:message, 1, message_type: 'outgoing', account: account, inbox: inbox, conversation: conversation, @@ -236,7 +236,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: 2.days.ago) conversation_in_range.reload - conversation_in_range.update_column(:assignee_id, user.id) + conversation_in_range.update!(assignee_id: user.id) conversation_in_range.update_labels('label_1') conversation_in_range.label_list conversation_in_range.save! @@ -253,7 +253,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: 1.week.ago) conversation_out_of_range.reload - conversation_out_of_range.update_column(:assignee_id, user.id) + conversation_out_of_range.update!(assignee_id: user.id) conversation_out_of_range.update_labels('label_1') conversation_out_of_range.label_list conversation_out_of_range.save! @@ -297,7 +297,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: Time.zone.today) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) conversation.update_labels('label_1') conversation.label_list conversation.save! @@ -356,7 +356,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do inbox: inbox, created_at: test_date) conversation.reload - conversation.update_column(:assignee_id, user.id) + conversation.update!(assignee_id: user.id) conversation.update_labels(unique_label_name) conversation.label_list conversation.save!