Skip to content
This repository has been archived by the owner on Jan 8, 2018. It is now read-only.

Fix crash of abscence overview without a year set #24

Merged
merged 1 commit into from
Jun 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/reports/absence_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def show
end

def calendar
@year ||= Time.now.year
if @month.nil?
@range = UberZeit.year_as_range(@year)
else
Expand Down
7 changes: 7 additions & 0 deletions spec/controllers/reports/absence_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
get :calendar, team_id: nil, month: nil, year: 2013
assigns(:range).should eq(UberZeit.year_as_range(2013))
end

context 'without a year set' do
it 'assigns the current year as range' do
get :calendar, team_id: nil
assigns(:range).should eq(UberZeit.year_as_range(Time.now.year))
end
end
end

describe 'special rights' do
Expand Down