From caa0a9f01c4f3a8ca85a0ce4e335c71235006432 Mon Sep 17 00:00:00 2001 From: Carlos Goce Date: Fri, 23 Jan 2015 18:49:44 +0100 Subject: Add a pending test. Day names are not localized --- spec/calendar_spec.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/calendar_spec.rb b/spec/calendar_spec.rb index e37e18d..fc78cc0 100644 --- a/spec/calendar_spec.rb +++ b/spec/calendar_spec.rb @@ -7,10 +7,11 @@ I18n.backend.load_translations describe 'Calendar' do before(:each) do - @calendar = CarlosGoce::Calendar.new + @calendar = CarlosGoce::Calendar.new 2015 end it 'should be initialized with the current year' do + @calendar = CarlosGoce::Calendar.new expect(@calendar.year).to eq Date.today.year end @@ -26,9 +27,20 @@ describe 'Calendar' do end it 'return the numbers of available days for each month' do - @calendar = CarlosGoce::Calendar.new 2015 expect(@calendar.to_h[1][:days]).to eq (1..31).to_a end + it 'return the days as names' do + expect(@calendar.to_h[1][:days_names].first).to eq 'thursday' + expect(@calendar.to_h[1][:days_names].count).to eq 31 + end + + it 'return the day names localized', + :pending => "Not working!!! Months are localized, why days aren't?" do + skip 'Is not working, the names are localized so why days are not?' + I18n.locale = 'es' + expect(@calendar.to_h[1][:days_names].first).to eq 'jueves' + end + end end \ No newline at end of file -- cgit v1.2.3