true
else
if @project && @project.archived?
+ @archived_project = @project
render_403 :message => :notice_not_authorized_archived_project
elsif @project && !@project.allows_to?(:controller => ctrl, :action => action)
# Project module is disabled
<% if @message.present? %>
<p id="errorExplanation"><%= @message %></p>
<% end %>
+
+<% if @archived_project && User.current.admin? %>
+ <p><%= link_to l(:button_unarchive), unarchive_project_path(@archived_project), :method => :post, :class => 'icon icon-unlock' %></p>
+<% end %>
+
<p><a href="javascript:history.back()"><%= l(:button_back) %></a></p>
<% html_title @status %>
assert_response :success
end
- def show_archived_project_should_be_denied
+ def test_show_archived_project_should_be_denied
project = Project.find_by_identifier('ecookbook')
- project.archive!
+ project.archive
get :show, :params => {
:id => 'ecookbook'
assert_not_include project.name, response.body
end
+ def test_show_archived_project_should_show_unarchive_link_to_admins
+ @request.session[:user_id] = 1
+ project = Project.find_by_identifier('ecookbook')
+ project.archive
+
+ get :show, :params => {
+ :id => 'ecookbook'
+ }
+ assert_response 403
+ assert_select 'a', :text => "Unarchive"
+ end
+
def test_show_should_not_show_private_subprojects_that_are_not_visible
get :show, :params => {
:id => 'ecookbook'