summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2024-04-22 04:30:38 -0400
committerGitHub <noreply@github.com>2024-04-22 08:30:38 +0000
commita15139bc02d279b9ef85e95990f41e3e88838d20 (patch)
tree26c6d3913f04700e91b6ae7a0030ea4d0a5128d5
parent24e67c4394bc545fc4b3e9bc4c3b87b0d98f36ee (diff)
Fix intermittent order based failure in `UpdateStatusService` spec (#30008)
-rw-r--r--spec/services/update_status_service_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/services/update_status_service_spec.rb b/spec/services/update_status_service_spec.rb
index 930f673e10a..47be53f4fc7 100644
--- a/spec/services/update_status_service_spec.rb
+++ b/spec/services/update_status_service_spec.rb
@@ -40,7 +40,7 @@ RSpec.describe UpdateStatusService do
end
it 'saves edit history' do
- expect(status.edits.pluck(:text)).to eq %w(Foo Bar)
+ expect(status.edits.ordered.pluck(:text)).to eq %w(Foo Bar)
end
end
@@ -58,7 +58,7 @@ RSpec.describe UpdateStatusService do
end
it 'saves edit history' do
- expect(status.edits.pluck(:text, :spoiler_text)).to eq [['Foo', ''], ['Foo', 'Bar']]
+ expect(status.edits.ordered.pluck(:text, :spoiler_text)).to eq [['Foo', ''], ['Foo', 'Bar']]
end
end
@@ -85,7 +85,7 @@ RSpec.describe UpdateStatusService do
end
it 'saves edit history' do
- expect(status.edits.pluck(:ordered_media_attachment_ids)).to eq [[detached_media_attachment.id], [attached_media_attachment.id]]
+ expect(status.edits.ordered.pluck(:ordered_media_attachment_ids)).to eq [[detached_media_attachment.id], [attached_media_attachment.id]]
end
end
@@ -107,7 +107,7 @@ RSpec.describe UpdateStatusService do
end
it 'saves edit history' do
- expect(status.edits.map { |edit| edit.ordered_media_attachments.map(&:description) }).to eq [['Old description'], ['New description']]
+ expect(status.edits.ordered.map { |edit| edit.ordered_media_attachments.map(&:description) }).to eq [['Old description'], ['New description']]
end
end
@@ -136,7 +136,7 @@ RSpec.describe UpdateStatusService do
end
it 'saves edit history' do
- expect(status.edits.pluck(:poll_options)).to eq [%w(Foo Bar), %w(Bar Baz Foo)]
+ expect(status.edits.ordered.pluck(:poll_options)).to eq [%w(Foo Bar), %w(Bar Baz Foo)]
end
it 'requeues expiration notification' do