From aa2e83153463e9848cd173090ca09ca23dc01cf9 Mon Sep 17 00:00:00 2001 From: Stephen Crosby Date: Mon, 14 Sep 2015 18:19:06 -0700 Subject: [PATCH] fixes #945 use the object / decorator interface for sorting --- app/views/problems/show.ics.haml | 2 +- spec/views/problems/show.ics.haml_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/problems/show.ics.haml b/app/views/problems/show.ics.haml index 835448a..0463a10 100644 --- a/app/views/problems/show.ics.haml +++ b/app/views/problems/show.ics.haml @@ -1 +1 @@ -= generate_problem_ical(problem.notices.order_by(:created_at.asc)) += generate_problem_ical(problem.notices.object.order_by(:created_at.asc)) diff --git a/spec/views/problems/show.ics.haml_spec.rb b/spec/views/problems/show.ics.haml_spec.rb index 1ae8de8..9bcfc3e 100644 --- a/spec/views/problems/show.ics.haml_spec.rb +++ b/spec/views/problems/show.ics.haml_spec.rb @@ -1,11 +1,11 @@ describe "problems/show.html.ics", type: 'view' do - let(:problem) { Fabricate(:problem) } + let(:problem) { ProblemDecorator.new(Fabricate(:problem)) } before do allow(view).to receive(:problem).and_return(problem) end - it 'should work' do + it 'works' do render :template => 'problems/show', :formats => [:ics], :handlers => [:haml] end end -- libgit2 0.21.2