]> source.dussan.org Git - redmine.git/commitdiff
Error raised on project settings after project wiki is deleted (#18429).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 28 Nov 2014 07:43:22 +0000 (07:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 28 Nov 2014 07:43:22 +0000 (07:43 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13660 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
test/functional/projects_controller_test.rb

index 11cb91a46ae4fbad5670783df33b5ecc4b8c4dba..7472129273f95a7d400a55e1b2c21b73b21c6c91 100644 (file)
@@ -162,7 +162,7 @@ class ProjectsController < ApplicationController
     @issue_category ||= IssueCategory.new
     @member ||= @project.members.new
     @trackers = Tracker.sorted.to_a
-    @wiki ||= @project.wiki
+    @wiki ||= @project.wiki || Wiki.new(:project => @project)
   end
 
   def edit
index 726148dad55f70c9562fe041f05978e6dc3f5964..6a564acdc22527254db4b3479d400a00027c3c14 100644 (file)
@@ -408,6 +408,20 @@ class ProjectsControllerTest < ActionController::TestCase
     assert_response 302
   end
 
+  def test_setting_with_wiki_module_and_no_wiki
+    Project.find(1).wiki.destroy
+    Role.find(1).add_permission! :manage_wiki
+    @request.session[:user_id] = 2
+
+    get :settings, :id => 1
+    assert_response :success
+    assert_template 'settings'
+
+    assert_select 'form[action=?]', '/projects/ecookbook/wiki' do
+      assert_select 'input[name=?]', 'wiki[start_page]'
+    end
+  end
+
   def test_update
     @request.session[:user_id] = 2 # manager
     post :update, :id => 1, :project => {:name => 'Test changed name',