32629.patch

Takenori TAKAKI, 2019-12-17 05:26

Download (1.44 KB)

View differences:

app/views/wiki/_sidebar.html.erb
1
<% if User.current.allowed_to?(:edit_wiki_pages, @project) &&
2
      (@wiki && @wiki.find_or_new_page('Sidebar').editable_by?(User.current)) %>
3
  <div class="contextual">
4
    <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'),
5
                :class => 'icon icon-edit' %>
6
  </div>
7
<% end -%>
8

  
1 9
<% if @wiki && @wiki.sidebar -%>
2 10
  <div class="wiki">
3 11
    <%= textilizable @wiki.sidebar.content, :text %>
test/functional/wiki_controller_test.rb
46 46
    assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation.txt'
47 47
  end
48 48

  
49
  def test_edit_sidebar_link
50
    Role.anonymous.add_permission! :edit_wiki_pages
51
    Role.anonymous.add_permission! :protect_wiki_pages
52
    get :show, :params => {:project_id => 'ecookbook'}
53
    assert_response :success
54
    assert_select 'a[href=?]', '/projects/ecookbook/wiki/sidebar/edit'
55
  end
56

  
49 57
  def test_show_page_with_name
50 58
    get :show, :params => {:project_id => 1, :id => 'Another_page'}
51 59
    assert_response :success