From e1a70c37b11cb893a126784cc3d94b01f7c6c041 Mon Sep 17 00:00:00 2001 From: Carlos Goce Date: Fri, 23 Jan 2015 18:13:02 +0100 Subject: Refactor data structure --- spec/calendar_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/calendar_spec.rb') diff --git a/spec/calendar_spec.rb b/spec/calendar_spec.rb index 71252b3..e7fe00b 100644 --- a/spec/calendar_spec.rb +++ b/spec/calendar_spec.rb @@ -14,15 +14,15 @@ describe 'Calendar' do expect(@calendar.year).to eq(Date.today.year) end - describe 'Return months and days of given year' do + describe 'Return a data structure with all needed data to generate a pdf' do it 'should have all months of the year' do expect(@calendar.to_h.count).to eq(12) end - it 'localize month names' do - expect(@calendar.to_h.keys.first.to_s).to eq('january') + it 'return month names localized' do + expect(@calendar.to_h[1][:name]).to eq('january') I18n.locale = 'es' - expect(@calendar.to_h.keys.first.to_s).to eq('enero') + expect(@calendar.to_h[1][:name]).to eq('enero') end end end \ No newline at end of file -- cgit v1.2.3