From 4aea2b1287cf218a1de3021f8cf4837665c50a2b Mon Sep 17 00:00:00 2001 From: Zachery Moneypenny Date: Thu, 28 Feb 2013 11:26:26 -0600 Subject: [PATCH] Add new unit test for construct_date_range_fragment --- spec/fitgem_helper_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/fitgem_helper_spec.rb b/spec/fitgem_helper_spec.rb index 607b477..36069e6 100644 --- a/spec/fitgem_helper_spec.rb +++ b/spec/fitgem_helper_spec.rb @@ -32,6 +32,13 @@ @client.construct_date_range_fragment({:end_date => '2011-03-07', :period => '7d'}) }.to raise_error(Fitgem::InvalidTimeRange) end + + it 'formats DateTime objects to the required date format' do + span_start = DateTime.new(1997, 4, 18, 9, 30, 30) + span_end = DateTime.new(1999, 10, 3, 15, 30, 30) + frag = @client.construct_date_range_fragment base_date: span_start, end_date: span_end + frag.should eq('date/1997-04-18/1999-10-03') + end end describe "#format_date" do