Skip to content

Commit

Permalink
fixed ceil issue with 0 count in pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Feb 13, 2012
1 parent b8bf2fd commit 6829cd5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ruote-kit/views/_pagination.html.haml
Expand Up @@ -17,7 +17,7 @@
= @count
= res

- las = ((@count / lim.to_f).ceil - 1) * lim
- las = lim < 1 ? @count : ((@count / lim.to_f).ceil - 1) * lim
- pre = [ 0, @skip - lim ].max
- nex = [ @skip + lim, las ].min

Expand Down
28 changes: 27 additions & 1 deletion spec/resources/errors_spec.rb
Expand Up @@ -36,7 +36,33 @@
end
end

describe 'with a running process that has an error' do
context 'with a running process that has no errors' do

before(:each) do

prepare_engine

@wfid = RuoteKit.engine.launch(
Ruote.define do
stall # sit there and do nothing
end
)

RuoteKit.engine.wait_for(2)
end

describe 'GET /_ruote/errors/:wfid' do

it 'returns an empty list' do

get "/_ruote/errors/#{@wfid}"

last_response.status.should == 200
end
end
end

context 'with a running process that has an error' do

before(:each) do

Expand Down

0 comments on commit 6829cd5

Please sign in to comment.