summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-08-09 19:40:55 +0000
committerRobert Speicher <robert@gitlab.com>2016-08-09 19:40:55 +0000
commitc7302216aea8e89ba6168c0d3519af310df1e33e (patch)
treee26b215f9be578d4dcdc9dcc9d7166217c5296a4
parent04ae276a3a54a6afcf0f8c0a2829acfcb44e9bf7 (diff)
parenta92281cecb80b5d85ebac3f9801de02bd3b3a6a8 (diff)
downloadgitlab-ce-c7302216aea8e89ba6168c0d3519af310df1e33e.tar.gz
Merge branch 'fix-broadcast-message-factory-date-range' into 'master'
TST: Use more accurate time windows so tests do not fail This MR sets the Datetime attributes of the of the broadcast messages factory more precisely. This MR is necessary to ensure that all specs which use the broadcast message factory will pass when run anywhere at any time. Currently, the way the 'starts_at' and 'ends_at' attributes are set,if the specs are run at one second to midnight, the broadcast message will expire in one second. I have changed it so that we are guaranteed a period of one day until expiration. I believe this is the desired behaviour and it's also consistent with the rest of the factory. See merge request !5674
-rw-r--r--spec/factories/broadcast_messages.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/factories/broadcast_messages.rb b/spec/factories/broadcast_messages.rb
index efe9803b1a7..c2fdf89213a 100644
--- a/spec/factories/broadcast_messages.rb
+++ b/spec/factories/broadcast_messages.rb
@@ -1,8 +1,8 @@
FactoryGirl.define do
factory :broadcast_message do
message "MyText"
- starts_at Date.yesterday
- ends_at Date.tomorrow
+ starts_at 1.day.ago
+ ends_at 1.day.from_now
trait :expired do
starts_at 5.days.ago