Commit aa2e83153463e9848cd173090ca09ca23dc01cf9

Authored by Stephen Crosby
1 parent 860a7f1b
Exists in master and in 1 other branch production

fixes #945 use the object / decorator interface for sorting

app/views/problems/show.ics.haml
1   -= generate_problem_ical(problem.notices.order_by(:created_at.asc))
  1 += generate_problem_ical(problem.notices.object.order_by(:created_at.asc))
... ...
spec/views/problems/show.ics.haml_spec.rb
1 1 describe "problems/show.html.ics", type: 'view' do
2   - let(:problem) { Fabricate(:problem) }
  2 + let(:problem) { ProblemDecorator.new(Fabricate(:problem)) }
3 3  
4 4 before do
5 5 allow(view).to receive(:problem).and_return(problem)
6 6 end
7 7  
8   - it 'should work' do
  8 + it 'works' do
9 9 render :template => 'problems/show', :formats => [:ics], :handlers => [:haml]
10 10 end
11 11 end
... ...