Skip to content

Commit

Permalink
Add new unit test for construct_date_range_fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachery Moneypenny committed Feb 28, 2013
1 parent 6fec2c5 commit 4aea2b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/fitgem_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4aea2b1

Please sign in to comment.