-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ical to generate the correct times while adjusting for timezon…
…e. Add test (#82)
- Loading branch information
Showing
3 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'test_helper' | ||
|
||
class CalendarTest < ActiveSupport::TestCase | ||
def setup | ||
@event = Event.create( | ||
'name' => "Toronto Ruby's One Year Anniversary", | ||
'location' => '<div>Some Office</div>', | ||
'rsvp_link' => 'https://test.com', | ||
'description' => '<div>DESCRIPTION</div>', | ||
'sponsor' => '', | ||
'sponsor_link' => '', | ||
'sponsor_logo' => '', | ||
'start_at' => '2024-11-26T00:30Z', | ||
'status' => 'published' | ||
) | ||
@calendar = Calendar.new([@event]) | ||
end | ||
|
||
test 'ical_time produces the correct time' do | ||
want = DateTime.parse('2024-11-25T19:30-05:00').to_i | ||
got = @calendar.send(:ical_time, @event.start_at) | ||
assert_same(want, got.to_i) | ||
end | ||
end |