Commit 147a5d7cdc78ebed5f888b900b75e5dbf646b8e5

Authored by GrazienoPellegrino
1 parent 09061ef2

ActionItem623: "Back to control panel" in "edit sideboxes" points to the wrong place



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2403 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/box_organizer/index.rhtml
1 <h1><%= _('Editing sideboxes')%></h1> 1 <h1><%= _('Editing sideboxes')%></h1>
2 2
3 <% button_bar do %> 3 <% button_bar do %>
4 - <%= lightbox_button('add', _('Add a block'), { :action => 'add_block' }) %>  
5 - <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> 4 + <%= lightbox_button('add', _('Add a block'), { :action => 'add_block' }) %>
  5 + <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %>
6 <% end %> 6 <% end %>
test/functional/environment_design_controller_test.rb
@@ -46,5 +46,12 @@ class EnvironmentDesignControllerTest &lt; Test::Unit::TestCase @@ -46,5 +46,12 @@ class EnvironmentDesignControllerTest &lt; Test::Unit::TestCase
46 l.reload 46 l.reload
47 assert_equal [{'name' => 'link 1', 'address' => '/address_1'}], l.links 47 assert_equal [{'name' => 'link 1', 'address' => '/address_1'}], l.links
48 end 48 end
  49 +
  50 + should 'create back link to environment control panel' do
  51 + login_as(create_admin_user(Environment.default))
  52 + get :index
  53 +
  54 + assert_tag :tag => 'a', :attributes => {:href => '/admin'}, :child => {:tag => 'span', :content => "Back to control panel"}
  55 + end
49 56
50 end 57 end
test/functional/profile_design_controller_test.rb
@@ -254,5 +254,14 @@ class ProfileDesignControllerTest &lt; Test::Unit::TestCase @@ -254,5 +254,14 @@ class ProfileDesignControllerTest &lt; Test::Unit::TestCase
254 assert_no_tag :tag => 'input', :attributes => {:type => 'radio', :value => 'ProductsBlock'} 254 assert_no_tag :tag => 'input', :attributes => {:type => 'radio', :value => 'ProductsBlock'}
255 end 255 end
256 256
  257 + should 'create back link to profile control panel' do
  258 + p = Profile.create!(:name => 'test_profile', :identifier => 'test_profile')
  259 +
  260 + login_as(create_user_with_permission('test_user','edit_profile_design',p).identifier )
  261 + get :index, :profile => p.identifier
  262 +
  263 + assert_tag :tag => 'a', :attributes => {:href => '/myprofile/test_profile'}
  264 + end
  265 +
257 end 266 end
258 267