[Git][noosfero/noosfero][stable-1.3] 7 commits: event: fix tests related to duration of event

Antonio Terceiro gitlab at mg.gitlab.com
Sat Nov 28 09:39:33 BRST 2015


Antonio Terceiro pushed to branch stable-1.3 at Noosfero / noosfero


Commits:
52ed533c by Daniela Feitosa at 2015-11-27T17:33:05Z
event: fix tests related to duration of event

(cherry picked from commit c153ab2b9d57d21a8f7a6dee51bd37e419099efd)

- - - - -
14e9b465 by Larissa Reis at 2015-11-27T17:33:05Z
newsletter: Fix moderation checkbox regex

  regex should work regardless of the position of id in the tag

(cherry picked from commit d1261c16e728b749b7f1337f3eb0b7986ec1d52a)

- - - - -
6028c27d by Larissa Reis at 2015-11-27T17:33:05Z
newsletter: Removes header padding in moderation page

(cherry picked from commit 674b489aea76116873d7a91f5758e24b013b06b3)

- - - - -
07f5c779 by Larissa Reis at 2015-11-27T17:33:05Z
newsletter: Fix test helper import

(cherry picked from commit 57c595aa428324b955bd82dd950ae556f4b47e71)

- - - - -
93d94eae by Antonio Terceiro at 2015-11-27T17:56:14Z
debian/changelog: fix target distribution for last 2 releases

- - - - -
0c4c19ea by Antonio Terceiro at 2015-11-27T18:48:16Z
util/debian-install: fix installing wheezy

(cherry picked from commit f2f58313bad6342cb8da53310729f7daccbec209)

- - - - -
3922ff20 by Antonio Terceiro at 2015-11-27T19:13:18Z
0-downtime upgrades with the Debian package

Instead of stopping the service, running migrations etc (those take
time), and then starting again, let's only restart the service after the
uprada has already happened. Now that we are using unicorn, which
supports restarting with dropping connections, with this we should have
0 downtime upgrades.

Also removed some unecessary buts deom debian/noosfero.prerm:

- remove restarting of memcached, which is broken behavior as it could
  affect other services using memcached. Just set a namespace for our
  cache keys, and all caches will be automatically invalidated when the
  application is restarted after an upgrade with a new version number

- remove removal of cache/*, since script/production already does that.

NOTE: since this behavior change depends on changes to the prerm
script, this won't take effect until the next upgrade _after_ the
upgrade to first version including this change.

- - - - -


12 changed files:

- config/environments/production.rb
- debian/changelog
- debian/noosfero.prerm
- debian/rules
- plugins/event/test/functional/event_block_test.rb
- plugins/event/views/event_plugin/event_block_item.html.erb
- plugins/newsletter/public/style.css
- plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
- plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
- plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
- util/debian-install/Vagrantfile
- util/debian-install/install


Changes:

=====================================
config/environments/production.rb
=====================================
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -44,7 +44,7 @@ Noosfero::Application.configure do
   # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
 
   # Use a different cache store in production
-  config.cache_store = :dalli_store, "127.0.0.1:11211"
+  config.cache_store = :dalli_store, "127.0.0.1:11211", { :namespace => "noosfero/#{Noosfero::VERSION}" }
 
   # Enable serving of images, stylesheets, and javascripts from an asset server
   # config.action_controller.asset_host                  = "http://assets.example.com"


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-noosfero (1.3.1) wheezy-test; urgency=low
+noosfero (1.3.1) wheezy; urgency=low
 
   * Bugfix release
 
  -- Antonio Terceiro <terceiro at colivre.coop.br>  Fri, 20 Nov 2015 15:59:38 -0300
 
-noosfero (1.3) wheezy-test; urgency=low
+noosfero (1.3) wheezy; urgency=low
 
   * Noosfero 1.3 final release
 


=====================================
debian/noosfero.prerm
=====================================
--- a/debian/noosfero.prerm
+++ b/debian/noosfero.prerm
@@ -8,14 +8,7 @@ dbc_go noosfero $@
 
 #DEBHELPER#
 
-# some dirty work is needed after Noosfero is stopped
 if [ "$1" = "upgrade" ]; then
-  # delete cached files
-  rm -f /var/lib/noosfero-data/cache/*
-
-  # restart memcache
-  invoke-rc.d memcached restart
-
   # stop debconf to avoid the problem with infinite hanging, cfe
   # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295477
   db_stop


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -25,7 +25,7 @@ override_dh_auto_install:
 	debian/filter-gemfile > $(CURDIR)/debian/noosfero/usr/share/noosfero/Gemfile
 
 override_dh_installinit:
-	dh_installinit -pnoosfero --onlyscripts
+	dh_installinit -pnoosfero --onlyscripts --restart-after-upgrade
 
 override_dh_clean:
 	dh_clean


=====================================
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
@@ -47,14 +47,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',


=====================================
plugins/newsletter/public/style.css
=====================================
--- a/plugins/newsletter/public/style.css
+++ b/plugins/newsletter/public/style.css
@@ -17,6 +17,11 @@
   margin-left: 10px;
 }
 
+#newsletter-moderation-preview th {
+  padding: 0px;
+  border: 0px;
+}
+
 #newsletter-moderation-preview input[type=checkbox] {
   margin-left: -27px;
   margin-top: 16px;


=====================================
plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
=====================================
--- a/plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
+++ b/plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../../test/test_helper'
+require 'test_helper'
 
 class NewsletterPluginAdminControllerTest < ActionController::TestCase
 


=====================================
plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
=====================================
--- a/plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
+++ b/plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../../test/test_helper'
+require 'test_helper'
 
 class NewsletterPluginControllerTest < ActionController::TestCase
 


=====================================
plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
=====================================
--- a/plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
+++ b/plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
@@ -3,14 +3,14 @@
 <h1><%= _('Check posts you want to include') %></h1>
 
 <div id='newsletter-moderation-preview'>
-  <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breaking-news-wrap']}/, '') %>
+  <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breakingnews-wrap']}/, '') %>
 
   <% newsletter.posts.each do |post| %>
     <% input_name = "tasks[#{task.id}][task][post_ids][]" %>
     <% post_check_box = hidden_field_tag(input_name, '0') +check_box_tag(input_name, post.id, true) %>
 
-    <% newsletter_content.gsub!(/<span id="#{post.id}"/, post_check_box+ '<span') %>
-    <% newsletter_content.gsub!(/<img id="#{post.id}"/, post_check_box+ '<img') %>
+    <% newsletter_content.gsub!(/<span([^>]*?) id="#{post.id}"/, post_check_box + '<span\\1')%>
+    <% newsletter_content.gsub!(/<img([^>]*?) id="#{post.id}"/, post_check_box + '<img\\1') %>
   <% end %>
 
   <%= newsletter_content %>


=====================================
util/debian-install/Vagrantfile
=====================================
--- a/util/debian-install/Vagrantfile
+++ b/util/debian-install/Vagrantfile
@@ -27,7 +27,7 @@ else
 end
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-  config.vm.box = "debian-wheezy"
+  config.vm.box = "debian/wheezy64"
   config.vm.provision :shell, path: 'install', args: [ENV['REPOSITORY']].compact
   config.vm.provision :shell, path: 'test'
 end


=====================================
util/debian-install/install
=====================================
--- a/util/debian-install/install
+++ b/util/debian-install/install
@@ -8,7 +8,7 @@ if [ -n "$1" ]; then
 fi
 
 set -e
-sudo apt-get install -qy netcat-traditional shunit2
+sudo apt-get install -qy netcat-traditional shunit2 curl
 
 # apt-cacher-ng running on the host
 # 10.0.2.2 = host ip on virtualbox/qemu
@@ -68,7 +68,7 @@ deb http://download.noosfero.org/debian/$REPOSITORY ./
 deb-src http://download.noosfero.org/debian/$REPOSITORY ./
 EOF
 
-sed -e "s/$DISTRO/&-backports/" \
+sed -e "/security/d; s/$DISTRO/&-backports/" \
   /etc/apt/sources.list > /etc/apt/sources.list.d/backports.list
 
 export DEBIAN_FRONTEND=noninteractive



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/db028c22a56c3d0f10a892d6fc2a5515abaea9d8...3922ff208398937dffe1d5df82d71aedef6d88c8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151128/bd96dbd3/attachment-0001.html>


More information about the Noosfero-dev mailing list