Commit e2feaba3c19d38a977898fe3c7367361bddb06eb

Authored by Larissa Reis
1 parent 30f970d2

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
app/helpers/cms_helper.rb
@@ -30,7 +30,7 @@ module CmsHelper @@ -30,7 +30,7 @@ module CmsHelper
30 end 30 end
31 31
32 def display_spread_button(article) 32 def display_spread_button(article)
33 - expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox', :modal => true} 33 + expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:modal => true}
34 end 34 end
35 35
36 def display_delete_button(article) 36 def display_delete_button(article)
app/views/content_viewer/_article_toolbar.html.erb
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 18
19 <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %> 19 <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %>
20 <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %> 20 <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %>
21 - <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox', :modal => true} if url %> 21 + <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:modal => true} if url %>
22 <% end %> 22 <% end %>
23 23
24 <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %> 24 <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %>
test/unit/cms_helper_test.rb
@@ -52,7 +52,7 @@ class CmsHelperTest &lt; ActionView::TestCase @@ -52,7 +52,7 @@ class CmsHelperTest &lt; ActionView::TestCase
52 plugins.stubs(:dispatch).returns([]) 52 plugins.stubs(:dispatch).returns([])
53 profile = fast_create(Person) 53 profile = fast_create(Person)
54 article = fast_create(TinyMceArticle, :name => 'My article', :profile_id => profile.id) 54 article = fast_create(TinyMceArticle, :name => 'My article', :profile_id => profile.id)
55 - expects(:link_to).with('Spread this', {:action => 'publish', :id => article.id}, :class => 'button with-text icon-spread colorbox', :title => nil) 55 + expects(:link_to).with('Spread this', {:action => 'publish', :id => article.id}, :class => 'modal-toggle button with-text icon-spread', :title => nil)
56 56
57 result = display_spread_button(article) 57 result = display_spread_button(article)
58 end 58 end