Skip to content

Commit 1a444c0

Browse files
WIP
1 parent d6f5a00 commit 1a444c0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

app/views/wiki/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
1717
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
1818
<% @redirects_to_self.map { |redirect| %>
19-
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", {} , :class => 'icon icon-link-break') %>
19+
<%= link_to("Delete redirect from #{WikiPage.pretty_title(redirect.title)}", project_redirect_path(@project, redirect), :class => 'icon icon-link-break') %>
2020
<% } %>
2121
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
2222
<% else %>

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,13 @@
190190
match 'preview', :via => [:post, :put, :patch]
191191
post 'protect'
192192
post 'add_attachment'
193+
193194
end
194195
collection do
195196
get 'export'
196197
get 'date_index'
197198
post 'new'
199+
# TODO: Move to member
198200
resources :redirects, controller: 'wiki_redirects', only: :destroy
199201
end
200202
end

test/functional/wiki_controller_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ def test_show_delete_redirect_links
201201
get :show, :params => {:project_id => 1, :id => new_title}
202202

203203
assert_select '.drdn-items' do
204+
# TODO: Assert correct link
205+
# assert_select 'a.icon-link-break[href=?]', '/projects/ecookbook/wiki/redirects/', text: 'Delete redirect from CookBook documentation'
206+
# assert_select 'a.icon-link-break[href=?]', '/projects/ecookbook/wiki/redirects/', text: 'Delete redirect from Old Cookbook'
204207
assert_select 'a.icon-link-break', text: 'Delete redirect from CookBook documentation'
205208
assert_select 'a.icon-link-break', text: 'Delete redirect from Old Cookbook'
206209
end

0 commit comments

Comments
 (0)