+<% if User.current.allowed_to?(:edit_wiki_pages, @project) &&
+ (@wiki && @wiki.find_or_new_page('Sidebar').editable_by?(User.current)) %>
+ <div class="contextual">
+ <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'),
+ :class => 'icon icon-edit' %>
+ </div>
+<% end -%>
+
<% if @wiki && @wiki.sidebar -%>
<div class="wiki">
<%= textilizable @wiki.sidebar.content, :text %>
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation.txt'
end
+ def test_edit_sidebar_link
+ Role.anonymous.add_permission! :edit_wiki_pages
+ Role.anonymous.add_permission! :protect_wiki_pages
+ get :show, :params => {:project_id => 'ecookbook'}
+ assert_response :success
+ assert_select 'a[href=?]', '/projects/ecookbook/wiki/sidebar/edit'
+ end
+
def test_show_page_with_name
get :show, :params => {:project_id => 1, :id => 'Another_page'}
assert_response :success