Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
da2f451f
Commit
da2f451f
authored
Jun 25, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set 2 weeks as the expiration time for the current broadcast message
parent
87b468c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+1
-1
spec/models/broadcast_message_spec.rb
spec/models/broadcast_message_spec.rb
+3
-3
No files found.
app/models/broadcast_message.rb
View file @
da2f451f
...
...
@@ -45,7 +45,7 @@ class BroadcastMessage < ApplicationRecord
end
def
self
.
cache_expires_in
nil
2
.
weeks
end
def
active?
...
...
spec/models/broadcast_message_spec.rb
View file @
da2f451f
...
...
@@ -48,14 +48,14 @@ describe BroadcastMessage do
expect
(
described_class
.
current
).
to
be_empty
end
it
'caches the output of the query'
do
it
'caches the output of the query
for two weeks
'
do
create
(
:broadcast_message
)
expect
(
described_class
).
to
receive
(
:current_and_future_messages
).
and_call_original
.
on
ce
expect
(
described_class
).
to
receive
(
:current_and_future_messages
).
and_call_original
.
twi
ce
described_class
.
current
Timecop
.
travel
(
1
.
year
)
do
Timecop
.
travel
(
3
.
weeks
)
do
described_class
.
current
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment