Commit 48614ae05f7b7257ccbf7b2b035c7cf0ec0a8fb7

Authored by Leandro Santos
1 parent b26b871e

fixing cucumber test

app/helpers/events_helper.rb
... ... @@ -30,7 +30,7 @@ module EventsHelper
30 30 # the day itself
31 31 date,
32 32 # is there any events in this date?
33   - events.any? {|event| event.date_range.include?(date)},
  33 + events.any? {|event| event.date_range.cover?(date)},
34 34 # is this date in the current month?
35 35 true
36 36 ]
... ...
app/models/category.rb
... ... @@ -81,7 +81,7 @@ class Category < ActiveRecord::Base
81 81 end
82 82  
83 83 def upcoming_events(limit = 10)
84   - self.events.paginate(:conditions => [ 'start_date >= ?', Date.today ], :order => 'start_date', :page => 1, :per_page => limit)
  84 + self.events.paginate(:conditions => [ 'start_date >= ?', DateTime.now.beginning_of_day ], :order => 'start_date', :page => 1, :per_page => limit)
85 85 end
86 86  
87 87 def display_in_menu?
... ...
features/events.feature
... ... @@ -223,7 +223,7 @@ Feature: events
223 223 | owner | name | start_date | end_date |
224 224 | josesilva | WikiSym 2009 | 2009-10-25 | 2009-10-27 |
225 225 When I am on /profile/josesilva/events/2009/10/26
226   - Then I should see "October 25, 2009 to October 27, 2009"
  226 + Then I should see "October 25, 2009 0:00 to October 27, 2009 0:00"
227 227  
228 228 Scenario: show place of the event
229 229 Given I am on /profile/josesilva/events/2009/10
... ...