Closed exegeteio closed 2 years ago
I was debating adding this to features/events/index_spec.rb
, but got concerned that the feature testing may become brittle if the definition of Event#ongoing_or_upcoming
changes.
As for events which end today, those should get included in the existing query.
As for events with only a few hours, I had not considered how those would be effected. I can switch to using Time.zone.now
for the comparison, unless it would better serve the user to include those events which happened today?
I was debating adding this to
features/events/index_spec.rb
, but got concerned that the feature testing may become brittle if the definition ofEvent#ongoing_or_upcoming
changes.
Would you consider a request spec a better choice? Really, we're just verifying the integration there. It only needs one test though. Just verifying that a past event isn't listed.
As for events which end today, those should get included in the existing query.
Thanks!
As for events with only a few hours, I had not considered how those would be effected. I can switch to using
Time.zone.now
for the comparison, unless it would better serve the user to include those events which happened today?
I think this is good. I can see someone wanting all events that happened today, but that can be an issue when someone wants it.
Updated with with a feature spec, comparison to the current time when requesting the Events, and (because it's used in multiple specs) a Factory for :past_event
. Hopefully a little humor is welcome in the Factories?