Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 21:08:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 21:08:19 +0300
commita8de96bff51846e160b76506dc0ca0fe6f767f64 (patch)
tree1036f1ca75aba492eaaa3439c84a3109b4684896 /spec/models/broadcast_message_spec.rb
parentafe2b984524ae4b0c8a0636db7ec5b2c452f0734 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/broadcast_message_spec.rb')
-rw-r--r--spec/models/broadcast_message_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/broadcast_message_spec.rb b/spec/models/broadcast_message_spec.rb
index 67d8284bebe..6cef81d6e44 100644
--- a/spec/models/broadcast_message_spec.rb
+++ b/spec/models/broadcast_message_spec.rb
@@ -65,6 +65,17 @@ describe BroadcastMessage do
end
end
+ it 'expires the value if a broadcast message has ended', :request_store do
+ message = create(:broadcast_message, broadcast_type: broadcast_type, ends_at: Time.now.utc + 1.day)
+
+ expect(subject.call).to match_array([message])
+ expect(described_class.cache).to receive(:expire).and_call_original
+
+ Timecop.travel(1.week) do
+ 2.times { expect(subject.call).to be_empty }
+ end
+ end
+
it 'does not create new records' do
create(:broadcast_message, broadcast_type: broadcast_type)