clerb/clerb-rails

Add test coverage for text displayed on Meetup link

Closed this issue · 2 comments

In the events list, we display "View on Meetup" if the event is in the past or "RSVP on Meetup" if the event is in the future:

screenshot 2018-09-18 12 46 50

It would be good to add test coverage for this distinction. I think it probably makes sense to put this under the events feature spec. It may also be helpful to add the timecop gem which lets you freeze time (so it's easy to set up "event is in the past" or "event is in the future" cases without the test being fragile as time passes).

Hope you don't mind - I took a crack at this. :)

I've been working with a ton of date-related manipulation in other languages recently so it was kind of interesting to see how this worked - Timecop is definitely a less painful way to do it than some of the other approaches I've tried.

Anyway, this is actually my first time working with rspec and Rails testing, so any feedback here is quite welcome. Thanks!

Implemented in #11