[Git][noosfero/noosfero][stable-1.2] Fixes test after spread button change to modal api

Antonio Terceiro gitlab at gitlab.com
Sat Oct 3 07:56:23 BRT 2015


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


Commits:
6dc56436 by Larissa Reis at 2015-10-03T07:55:55Z
Fixes test after spread button change to modal api

Fixes test broken after changing spread button to use modal api. Also
removes colorbox class that I forgot to remove in previous commit, since
now we are using modal api. For reference see commit:
edcc13059b31341eb78e58079ac2322f1142f206

(cherry picked from commit e2feaba3c19d38a977898fe3c7367361bddb06eb)

- - - - -


3 changed files:

- app/helpers/cms_helper.rb
- app/views/content_viewer/_article_toolbar.html.erb
- test/unit/cms_helper_test.rb


Changes:

=====================================
app/helpers/cms_helper.rb
=====================================
--- a/app/helpers/cms_helper.rb
+++ b/app/helpers/cms_helper.rb
@@ -30,7 +30,7 @@ module CmsHelper
   end
 
   def display_spread_button(article)
-    expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox', :modal => true}
+    expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:modal => true}
   end
 
   def display_delete_button(article)


=====================================
app/views/content_viewer/_article_toolbar.html.erb
=====================================
--- a/app/views/content_viewer/_article_toolbar.html.erb
+++ b/app/views/content_viewer/_article_toolbar.html.erb
@@ -18,7 +18,7 @@
 
     <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %>
       <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %>
-      <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox', :modal => true} if url %>
+      <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:modal => true} if url %>
     <% end %>
 
     <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %>


=====================================
test/unit/cms_helper_test.rb
=====================================
--- a/test/unit/cms_helper_test.rb
+++ b/test/unit/cms_helper_test.rb
@@ -52,7 +52,7 @@ class CmsHelperTest < ActionView::TestCase
     plugins.stubs(:dispatch).returns([])
     profile = fast_create(Person)
     article = fast_create(TinyMceArticle, :name => 'My article', :profile_id => profile.id)
-    expects(:link_to).with('Spread this', {:action => 'publish', :id => article.id}, :class => 'button with-text icon-spread colorbox', :title => nil)
+    expects(:link_to).with('Spread this', {:action => 'publish', :id => article.id}, :class => 'modal-toggle button with-text icon-spread', :title => nil)
 
     result = display_spread_button(article)
   end



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/6dc56436db7a51aa488b1b893fd47ac7974d2e35
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151003/64aa3db3/attachment.html>


More information about the Noosfero-dev mailing list