Commit 48614ae05f7b7257ccbf7b2b035c7cf0ec0a8fb7

Authored by Leandro Santos
1 parent b26b871e

fixing cucumber test

app/helpers/events_helper.rb
@@ -30,7 +30,7 @@ module EventsHelper @@ -30,7 +30,7 @@ module EventsHelper
30 # the day itself 30 # the day itself
31 date, 31 date,
32 # is there any events in this date? 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 # is this date in the current month? 34 # is this date in the current month?
35 true 35 true
36 ] 36 ]
app/models/category.rb
@@ -81,7 +81,7 @@ class Category < ActiveRecord::Base @@ -81,7 +81,7 @@ class Category < ActiveRecord::Base
81 end 81 end
82 82
83 def upcoming_events(limit = 10) 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 end 85 end
86 86
87 def display_in_menu? 87 def display_in_menu?
features/events.feature
@@ -223,7 +223,7 @@ Feature: events @@ -223,7 +223,7 @@ Feature: events
223 | owner | name | start_date | end_date | 223 | owner | name | start_date | end_date |
224 | josesilva | WikiSym 2009 | 2009-10-25 | 2009-10-27 | 224 | josesilva | WikiSym 2009 | 2009-10-25 | 2009-10-27 |
225 When I am on /profile/josesilva/events/2009/10/26 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 Scenario: show place of the event 228 Scenario: show place of the event
229 Given I am on /profile/josesilva/events/2009/10 229 Given I am on /profile/josesilva/events/2009/10