Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
commit
983cdebbb6
@ -0,0 +1,122 @@
|
|||||||
|
jfm_001:
|
||||||
|
id: 45
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: 我觉得这个系统挺实用,界面挺简洁美观!
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-16 15:27:2
|
||||||
|
updated_on: 2013-08-16 15:27:2
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_048:
|
||||||
|
id: 48
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: aqfbLT <a href=\"http://wcqmhgdpgfvy.com/\">wcqmhgdpgfvy</a>, [url=http://flyhqtjjtskb.com/]flyhqtjjtskb[/url],
|
||||||
|
[link=http://idlilqzxissn.com/]idlilqzxissn[/link], http://sfeezearevbp.com/
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-18 20:44:18
|
||||||
|
updated_on: 2013-08-18 20:44:18
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_049:
|
||||||
|
id: 49
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: 搜索用户时,若无对应结果,没有返回提示信息,比如不会提示:暂无此人
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-19 08:45:27
|
||||||
|
updated_on: 2013-08-19 08:45:27
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_058:
|
||||||
|
id: 58
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: 问题板块中 “新建问题”能不能移动到靠右~
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-20 00:24:44
|
||||||
|
updated_on: 2013-08-20 00:24:44
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_060:
|
||||||
|
id: 60
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: something very nice
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-21 07:04:43
|
||||||
|
updated_on: 2013-08-21 07:04:43
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_086:
|
||||||
|
id: 86
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: 谢谢大家的反馈!
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-23 02:36:48
|
||||||
|
updated_on: 2013-08-23 02:36:48
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_087:
|
||||||
|
id: 87
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: ”与我相关“处不可以直接回复
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-23 02:44:56
|
||||||
|
updated_on: 2013-08-23 02:44:56
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_088:
|
||||||
|
id: 88
|
||||||
|
jour_id: 2
|
||||||
|
jour_type: Project
|
||||||
|
user_id: 2
|
||||||
|
notes: 任何有关回复的地方可在任意显示处回复
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2013-08-23 02:45:45
|
||||||
|
updated_on: 2013-08-23 02:45:45
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
|
@ -0,0 +1,95 @@
|
|||||||
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
|
class ProjectsControllerTest < ActionController::TestCase
|
||||||
|
fixtures :projects,
|
||||||
|
:issues,
|
||||||
|
:issue_statuses,
|
||||||
|
:enumerations,
|
||||||
|
:users,
|
||||||
|
:issue_categories,
|
||||||
|
:trackers,
|
||||||
|
:projects_trackers,
|
||||||
|
:roles,
|
||||||
|
:member_roles,
|
||||||
|
:members,
|
||||||
|
:enabled_modules,
|
||||||
|
:journals,
|
||||||
|
:journal_details,
|
||||||
|
:journals_for_messages
|
||||||
|
|
||||||
|
def setup
|
||||||
|
@request.session[:user_id] = nil
|
||||||
|
@request.session[:ctime] = Time.now
|
||||||
|
@request.session[:atime] = Time.now
|
||||||
|
Setting.default_language = 'en'
|
||||||
|
end
|
||||||
|
|
||||||
|
test 'get :index' do
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
test ':new by admin should accept get' do
|
||||||
|
@request.session[:user_id] = 1
|
||||||
|
get :new
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
test ':new by non-admin user with add_project permission should accept get' do
|
||||||
|
Role.non_member.add_permission! :add_project
|
||||||
|
@request.session[:user_id] = 9
|
||||||
|
get :new
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'new'
|
||||||
|
end
|
||||||
|
|
||||||
|
test ':create by admin user should create a new project' do
|
||||||
|
@request.session[:user_id] = 1
|
||||||
|
post :create, :project => {
|
||||||
|
name: "blog1",
|
||||||
|
description: 'weblog',
|
||||||
|
homepage: 'http://weblog',
|
||||||
|
identifier: 'blog',
|
||||||
|
is_public: 1,
|
||||||
|
custom_field_values: {'3' => 'Beta'},
|
||||||
|
tracker_ids: ['1', '3'],
|
||||||
|
:issue_custom_field_ids => ['9'],
|
||||||
|
:enabled_module_names => ['issue_tracking', 'news', 'repository']
|
||||||
|
}
|
||||||
|
project = Project.find_by_name(blog)
|
||||||
|
assert_not_nil project
|
||||||
|
assert_redirected_to "/projects/#{project.id}/settings"
|
||||||
|
|
||||||
|
assert_kind_of Project, project
|
||||||
|
assert project.active?
|
||||||
|
assert_equal 'weblog', project.description
|
||||||
|
assert_equal 'http://weblog', project.homepage
|
||||||
|
assert_equal true, project.is_public?
|
||||||
|
assert_nil project.parent
|
||||||
|
assert_equal 'Beta', project.custom_value_for(3).value
|
||||||
|
assert_equal [1, 3], project.trackers.map(&:id).sort
|
||||||
|
assert_equal ['issue_tracking', 'news', 'repository'], project.enabled_module_names.sort
|
||||||
|
assert project.issue_custom_fields.include?(IssueCustomField.find(9))
|
||||||
|
end
|
||||||
|
|
||||||
|
test 'get :show trustie' do
|
||||||
|
get :show, {id: 2}
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test 'get :search, forge' do
|
||||||
|
query_condition = "forge"
|
||||||
|
get :search, {'name' => query_condition }
|
||||||
|
projects = assigns(:projects_all)
|
||||||
|
assert projects.any?, "projects should have anything."
|
||||||
|
projects.each do |project|
|
||||||
|
assert project.name.downcase.include?(query_condition), "project name is invalid: #{project.name}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
test 'get :feedback' do
|
||||||
|
get :feedback, {id: 2}
|
||||||
|
assert_response :success
|
||||||
|
# prject_id = 2 总有8个留言
|
||||||
|
assert_equal assigns(:jour).count, 8
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in new issue