spec/timeframe_spec.rb in timeframe-0.0.2 vs spec/timeframe_spec.rb in timeframe-0.0.3
- old
+ new
@@ -252,9 +252,14 @@
describe '#to_json' do
it 'should generate JSON' do
Timeframe.new(:year => 2009).to_json.should == "{\"from\":\"2009-01-01\",\"to\":\"2010-01-01\"}"
end
+ it 'should ignore any arguments you give it' do
+ example = Timeframe.new(:year => 2009).to_json
+ Timeframe.new(:year => 2009).to_json('hi').should == example
+ Timeframe.new(:year => 2009).to_json('hi', 'there').should == example
+ end
end
describe '#to_param' do
it 'should generate a URL-friendly parameter' do
Timeframe.new(:year => 2009).to_param.should == "2009-01-01/2010-01-01"