Commit 4239e83e362161ada6a2fedb9c6286da7caa08c3

Authored by Jared Pace
1 parent 9ab86ab5
Exists in master and in 1 other branch production

Errs#index

app/controllers/errs_controller.rb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +class ErrsController < ApplicationController
  2 +
  3 + def index
  4 + @errs = Err.unresolved.paginate(:page => params[:page])
  5 + end
  6 +
  7 +end
... ...
app/views/errs/_table.html.haml
... ... @@ -14,7 +14,7 @@
14 14 %td.environment
15 15 %abbr{:title => err.environment}= err.environment.chars.first.upcase
16 16 - unless @project
17   - %td.project= err.project
  17 + %td.project= err.project.name
18 18 %td.message
19 19 = link_to err.message, project_err_path(err.project, err)
20 20 %em= err.where
... ...
app/views/errs/index.html.haml 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +- content_for :title, 'Unresolved Errors'
  2 +
  3 += render 'table', :errs => @errs
0 4 \ No newline at end of file
... ...
spec/controllers/errs_controller_spec.rb 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +require 'spec_helper'
  2 +
  3 +describe ErrsController do
  4 +
  5 + let(:project) { Factory(:project) }
  6 +
  7 + describe "GET /errs" do
  8 + it "gets a paginated list of unresolved errors" do
  9 + errors = WillPaginate::Collection.new(1,30)
  10 + 3.times { errors << Factory(:err, :project => project) }
  11 + Err.should_receive(:unresolved).and_return(mock('proxy', :paginate => errors))
  12 + get :index
  13 + assigns(:errs).should == errors
  14 + end
  15 + end
  16 +
  17 +end
... ...