# Export wiki to a single pdf or html file
def export
- unless User.current.allowed_to?(:export_wiki_pages, @project)
- redirect_to :action => 'show', :project_id => @project, :id => nil
- return
- end
-
@pages = @wiki.pages.all(:order => 'title', :include => [:content, :attachments], :limit => 75)
respond_to do |format|
format.html {
assert @response.body.starts_with?('%PDF')
end
- def test_export_without_permission_should_redirect
+ def test_export_without_permission_should_be_denied
+ @request.session[:user_id] = 2
+ Role.find_by_name('Manager').remove_permission! :export_wiki_pages
get :export, :project_id => 'ecookbook'
- assert_response 302
+ assert_response 403
end
def test_date_index