[Git][noosfero/noosfero][master] fixing cucumber test

Leandro Nunes gitlab at gitlab.com
Thu Aug 13 16:11:44 BRT 2015


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
48614ae0 by Leandro Nunes dos Santos at 2015-08-13T16:11:11Z
fixing cucumber test

- - - - -


3 changed files:

- app/helpers/events_helper.rb
- app/models/category.rb
- features/events.feature


Changes:

=====================================
app/helpers/events_helper.rb
=====================================
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -30,7 +30,7 @@ module EventsHelper
         # the day itself
         date,
         # is there any events in this date?
-        events.any? {|event| event.date_range.include?(date)},
+        events.any? {|event| event.date_range.cover?(date)},
         # is this date in the current month?
         true
       ]


=====================================
app/models/category.rb
=====================================
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -81,7 +81,7 @@ class Category < ActiveRecord::Base
   end
 
   def upcoming_events(limit = 10)
-    self.events.paginate(:conditions => [ 'start_date >= ?', Date.today ], :order => 'start_date', :page => 1, :per_page => limit)
+    self.events.paginate(:conditions => [ 'start_date >= ?', DateTime.now.beginning_of_day ], :order => 'start_date', :page => 1, :per_page => limit)
   end
 
   def display_in_menu?


=====================================
features/events.feature
=====================================
--- a/features/events.feature
+++ b/features/events.feature
@@ -223,7 +223,7 @@ Feature: events
       | owner     | name         | start_date | end_date   |
       | josesilva | WikiSym 2009 | 2009-10-25 | 2009-10-27 |
     When I am on /profile/josesilva/events/2009/10/26
-    Then I should see "October 25, 2009 to October 27, 2009"
+    Then I should see "October 25, 2009 0:00 to October 27, 2009 0:00"
 
   Scenario: show place of the event
     Given I am on /profile/josesilva/events/2009/10



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/48614ae05f7b7257ccbf7b2b035c7cf0ec0a8fb7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150813/62c0a878/attachment.html>


More information about the Noosfero-dev mailing list