diff --git a/app/views/box_organizer/index.rhtml b/app/views/box_organizer/index.rhtml
index 767fb85..e49a906 100644
--- a/app/views/box_organizer/index.rhtml
+++ b/app/views/box_organizer/index.rhtml
@@ -1,6 +1,6 @@
<%= _('Editing sideboxes')%>
<% button_bar do %>
- <%= lightbox_button('add', _('Add a block'), { :action => 'add_block' }) %>
- <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
+ <%= lightbox_button('add', _('Add a block'), { :action => 'add_block' }) %>
+ <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %>
<% end %>
diff --git a/test/functional/environment_design_controller_test.rb b/test/functional/environment_design_controller_test.rb
index 1e43cdb..b58c02b 100644
--- a/test/functional/environment_design_controller_test.rb
+++ b/test/functional/environment_design_controller_test.rb
@@ -46,5 +46,12 @@ class EnvironmentDesignControllerTest < Test::Unit::TestCase
l.reload
assert_equal [{'name' => 'link 1', 'address' => '/address_1'}], l.links
end
+
+ should 'create back link to environment control panel' do
+ login_as(create_admin_user(Environment.default))
+ get :index
+
+ assert_tag :tag => 'a', :attributes => {:href => '/admin'}, :child => {:tag => 'span', :content => "Back to control panel"}
+ end
end
diff --git a/test/functional/profile_design_controller_test.rb b/test/functional/profile_design_controller_test.rb
index 0ea9823..1bc4ecd 100644
--- a/test/functional/profile_design_controller_test.rb
+++ b/test/functional/profile_design_controller_test.rb
@@ -254,5 +254,14 @@ class ProfileDesignControllerTest < Test::Unit::TestCase
assert_no_tag :tag => 'input', :attributes => {:type => 'radio', :value => 'ProductsBlock'}
end
+ should 'create back link to profile control panel' do
+ p = Profile.create!(:name => 'test_profile', :identifier => 'test_profile')
+
+ login_as(create_user_with_permission('test_user','edit_profile_design',p).identifier )
+ get :index, :profile => p.identifier
+
+ assert_tag :tag => 'a', :attributes => {:href => '/myprofile/test_profile'}
+ end
+
end
--
libgit2 0.21.2