Commit 73e1db5a96f38899f36a0960e7b39d1f20c29771

Authored by Rodrigo Souto
2 parents 533f3100 1c2bcef6

Merge branch 'stable' of https://gitlab.com/noosfero/noosfero into stable

app/controllers/public/events_controller.rb
@@ -21,7 +21,7 @@ class EventsController < PublicController @@ -21,7 +21,7 @@ class EventsController < PublicController
21 21
22 def events_by_day 22 def events_by_day
23 @date = build_date(params[:year], params[:month], params[:day]) 23 @date = build_date(params[:year], params[:month], params[:day])
24 - @events = profile.events.by_day(@date) 24 + @events = profile.events.by_day(@date).paginate(:per_page => per_page, :page => params[:page])
25 render :partial => 'events' 25 render :partial => 'events'
26 end 26 end
27 27
test/functional/events_controller_test.rb
@@ -46,4 +46,12 @@ class EventsControllerTest < ActionController::TestCase @@ -46,4 +46,12 @@ class EventsControllerTest < ActionController::TestCase
46 assert_equal 20, assigns(:events).count 46 assert_equal 20, assigns(:events).count
47 end 47 end
48 48
  49 + should 'show events of specific day' do
  50 + profile.events << Event.new(:name => 'Joao Birthday', :start_date => Date.new(2009, 10, 28))
  51 +
  52 + get :events_by_day, :profile => profile.identifier, :year => 2009, :month => 10, :day => 28
  53 +
  54 + assert_tag :tag => 'a', :content => /Joao Birthday/
  55 + end
  56 +
49 end 57 end