[Git][noosfero/noosfero][master] event: fix tests related to duration of event

Daniela Feitosa gitlab at mg.gitlab.com
Fri Nov 20 16:10:36 BRST 2015


Daniela Feitosa pushed to branch master at Noosfero / noosfero


Commits:
c153ab2b by Daniela Feitosa at 2015-11-20T18:07:12Z
event: fix tests related to duration of event

- - - - -


2 changed files:

- plugins/event/test/functional/event_block_test.rb
- plugins/event/views/event_plugin/event_block_item.html.erb


Changes:

=====================================
plugins/event/test/functional/event_block_test.rb
=====================================
--- a/plugins/event/test/functional/event_block_test.rb
+++ b/plugins/event/test/functional/event_block_test.rb
@@ -38,14 +38,14 @@ class HomeControllerTest < ActionController::TestCase
     @e1a.end_date = DateTime.now + 1.day
     @e1a.save!
     get :index
-    assert_select ev + 'time.duration[itemprop="endDate"]', /1 day/
+    assert_select ev + 'time.duration[itemprop="endDate"]', /2 days/
 
     @e1a.slug = 'event1a'
     @e1a.start_date = DateTime.now
     @e1a.end_date = DateTime.now + 2.day
     @e1a.save!
     get :index
-    assert_select ev + 'time.duration[itemprop="endDate"]', /2 days/
+    assert_select ev + 'time.duration[itemprop="endDate"]', /3 days/
   end
 
   should 'not see event duration for one day events' do


=====================================
plugins/event/views/event_plugin/event_block_item.html.erb
=====================================
--- a/plugins/event/views/event_plugin/event_block_item.html.erb
+++ b/plugins/event/views/event_plugin/event_block_item.html.erb
@@ -1,7 +1,7 @@
 <%
   # compute layout values
   ev_days_tag = ''
-  if event.duration > 0
+  if event.duration > 1
     ev_days_tag = content_tag('time',
       n_('Duration: 1 day', 'Duration: %s days', event.duration) % "<b>#{event.duration}</b>",
       :itemprop => 'endDate',



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/c153ab2b9d57d21a8f7a6dee51bd37e419099efd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151120/1130f65c/attachment.html>


More information about the Noosfero-dev mailing list