Only show changesets that are actually closed in the index view.

This commit is contained in:
Thomas Wood 2008-12-31 16:14:39 +00:00
parent d6a1ccf6b4
commit 8fe53e4823
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@ class BrowseController < ApplicationController
end
def index
@changesets = Changeset.find(:all, :order => "closed_at DESC", :limit=> 20)
@changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
end
def relation

View file

@ -20,7 +20,7 @@ class BrowseControllerTest < ActionController::TestCase
# This should display the last 20 changesets closed.
def test_index
@changesets = Changeset.find(:all, :order => "closed_at DESC", :limit=> 20)
@changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
assert @changesets.size <= 20
get :index
assert_response :success