Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -24,48 +26,8 @@ class WikisControllerTest < Redmine::ControllerTest
|
|||
User.current = nil
|
||||
end
|
||||
|
||||
def test_create
|
||||
@request.session[:user_id] = 1
|
||||
assert_nil Project.find(3).wiki
|
||||
|
||||
assert_difference 'Wiki.count' do
|
||||
post :edit, :params => {:id => 3, :wiki => { :start_page => 'Start page' }}, :xhr => true
|
||||
assert_response :success
|
||||
assert_equal 'text/javascript', response.content_type
|
||||
end
|
||||
|
||||
wiki = Project.find(3).wiki
|
||||
assert_not_nil wiki
|
||||
assert_equal 'Start page', wiki.start_page
|
||||
end
|
||||
|
||||
def test_create_with_failure
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
assert_no_difference 'Wiki.count' do
|
||||
post :edit, :params => {:id => 3, :wiki => { :start_page => '' }}, :xhr => true
|
||||
assert_response :success
|
||||
assert_equal 'text/javascript', response.content_type
|
||||
end
|
||||
|
||||
assert_include 'errorExplanation', response.body
|
||||
assert_include "Start page cannot be blank", response.body
|
||||
end
|
||||
|
||||
def test_update
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
assert_no_difference 'Wiki.count' do
|
||||
post :edit, :params => {:id => 1, :wiki => { :start_page => 'Other start page' }}, :xhr => true
|
||||
assert_response :success
|
||||
assert_equal 'text/javascript', response.content_type
|
||||
end
|
||||
|
||||
wiki = Project.find(1).wiki
|
||||
assert_equal 'Other start page', wiki.start_page
|
||||
end
|
||||
|
||||
def test_get_destroy_should_ask_confirmation
|
||||
set_tmp_attachments_directory
|
||||
@request.session[:user_id] = 1
|
||||
assert_no_difference 'Wiki.count' do
|
||||
get :destroy, :params => {:id => 1}
|
||||
|
@ -74,6 +36,7 @@ class WikisControllerTest < Redmine::ControllerTest
|
|||
end
|
||||
|
||||
def test_post_destroy_should_delete_wiki
|
||||
set_tmp_attachments_directory
|
||||
@request.session[:user_id] = 1
|
||||
post :destroy, :params => {:id => 1, :confirm => 1}
|
||||
assert_redirected_to :controller => 'projects',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue