This commit is contained in:
yanxd 2014-07-29 12:05:24 +08:00
parent d8fcf8eb9b
commit 233f041cc5
9 changed files with 118 additions and 250 deletions

View File

@ -1,9 +1,15 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one: courses_001_infos:
typeId: 1 id: 1
typeName: MyString course_id: 1
user_id: 20
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
courses_002_infos:
id: 2
course_id: 2
user_id: 20
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
two:
typeId: 1
typeName: MyString

View File

@ -1,15 +1,18 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
courses_001_statuses:
one:
changesets_count: 1 changesets_count: 1
watchers_count: 1 watchers_count: 1
course_id: 1 course_id: 1
grade: 1.5 grade: 1.5
course_ac_para: 1 course_ac_para: 1
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
two: courses_002_statuses:
changesets_count: 1 changesets_count: 1
watchers_count: 1 watchers_count: 1
course_id: 1 course_id: 2
grade: 1.5 grade: 1.5
course_ac_para: 1 course_ac_para: 1
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41

View File

@ -1,23 +1,23 @@
--- ---
courses_invalid_001: courses_001:
id: 1 id: 1
tea_id: tea_id: 20
name: '' name: courses_001
state: state:
code: code:
time: time: 2013
extra: extra:
created_at: 2013-09-30 15:36:00.000000000 Z created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41.000000000 Z updated_at: 2014-04-19 01:50:41
location: location:
term: term: 春季学期
string: string:
password: password: '1234'
setup_time: setup_time:
endup_time: endup_time: '2014-04-18 00:00:00'
class_period: class_period: '32'
school_id: school_id: 117
description: description: 'courses_001 description'
status: 1 status: 1
attachmenttype: 2 attachmenttype: 2
lft: lft:
@ -25,16 +25,16 @@ courses_invalid_001:
is_public: 1 is_public: 1
inherit_members: 1 inherit_members: 1
courses_008: courses_002:
id: 8 id: 2
tea_id: 5 tea_id: 20
name: 分布式计算环境 name: 分布式计算环境
state: state:
code: code:
time: 2013 time: 2013
extra: course2013-09-30_23-36-00 extra: course2013-09-30_23-36-00
created_at: 2013-09-30 15:36:00.000000000 Z created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41.000000000 Z updated_at: 2014-04-19 01:50:41
location: location:
term: 春季学期 term: 春季学期
string: string:
@ -50,129 +50,3 @@ courses_008:
rgt: rgt:
is_public: 1 is_public: 1
inherit_members: 1 inherit_members: 1
courses_058:
id: 58
tea_id: 1168
name: 软件工程实践
state:
code:
time: 2014
extra: course2014-04-17_17-12-17
created_at: 2014-04-17 09:12:17.000000000 Z
updated_at: 2014-04-17 09:12:17.000000000 Z
location:
term: 春季学期
string:
password: SEP2014
setup_time:
endup_time:
class_period: '18'
school_id: 0
description: 国防科技大学计算机学院工程硕士专业选修课。
status: 1
attachmenttype: 2
lft:
rgt:
is_public: 1
inherit_members: 1
courses_059:
id: 59
tea_id: 193
name: 软件项目管理
state:
code:
time: 2014
extra: course2014-04-18_18-10-46
created_at: 2014-04-18 10:10:46.000000000 Z
updated_at: 2014-04-18 10:10:46.000000000 Z
location:
term: 春季学期
string:
password: software
setup_time:
endup_time:
class_period: '30'
school_id: 0
description: 面向“软件工程”专业的本科生
status: 1
attachmenttype: 2
lft:
rgt:
is_public: 1
inherit_members: 1
courses_060:
id: 60
tea_id: 1179
name: android开发
state:
code:
time: 2014
extra: course2014-04-19_15-40-39
created_at: 2014-04-19 07:40:39.000000000 Z
updated_at: 2014-04-19 07:40:39.000000000 Z
location:
term: 春季学期
string:
password: trustie740208
setup_time:
endup_time:
class_period: '48'
school_id: 37
description: ''
status: 1
attachmenttype: 2
lft:
rgt:
is_public: 1
inherit_members: 1
courses_061:
id: 61
tea_id: 29
name: 测试课程1
state:
code:
time: 2014
extra: course2014-06-04_14-51-56
created_at: 2014-06-04 06:51:56.000000000 Z
updated_at: 2014-07-15 01:40:49.000000000 Z
location:
term: 春季学期
string:
password: '1234'
setup_time:
endup_time: '2014-07-14 00:00:00'
class_period: '23'
school_id: 1579
description: '233'
status: 1
attachmenttype: 2
lft:
rgt:
is_public: 0
inherit_members: 1
course_trustie_074:
id: 74
tea_id: 698
name: 电路与电子学基础(软件工程专业)
state:
code:
time: 2014
extra: course2014-05-22_16-09-25
created_at: 2014-05-22 08:09:25.000000000 Z
updated_at: 2014-05-22 08:09:25.000000000 Z
location:
term: 春季学期
string:
password: '12345678'
setup_time:
endup_time:
class_period: '54'
school_id: 117
description: "电路与电子学基础,软件工程小班\\r\ 模拟电子技术部分\ "
status: 1
attachmenttype: 2
lft:
rgt:
is_public: 1
inherit_members: 1

View File

@ -47,8 +47,3 @@ member_roles_011:
role_id: 2 role_id: 2
member_id: 10 member_id: 10
inherited_from: 10 inherited_from: 10
member_roles_179:
id: 179
member_id: 126
role_id: 3
inherited_from:

View File

@ -60,10 +60,3 @@ members_010:
project_id: 2 project_id: 2
user_id: 8 user_id: 8
mail_notification: false mail_notification: false
members_course_001:
id: 126
user_id: 5
project_id: -1
created_on: 2013-09-30 15:36:00.000000000 Z
mail_notification: false
course_id: 8

View File

@ -1,9 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one: school_117:
name: id: 117
province: MyString name: 国防科学技术大学
province: 湖南省
logo_link:
two: school_001:
name: id: 1
province: MyString name: 摧毁地球人学校
province: 火星
logo_link:

View File

@ -1,76 +1,57 @@
person_one_extra: user_extension_006:
id: 44 id: 6
user_id: 29 user_id: 6
birthday: "2013-09-30 21:19:25"
brief_introduction: nil
gender: 1
location: "江苏"
occupation: ""
work_experience: nil
zip_code: nil
created_at: "2013-09-30 21:19:25"
updated_at: "2013-10-09 19:00:06"
technical_title: nil
identity: 2
student_id: nil
teacher_realname: nil
student_realname: nil
location_city: "南京"
person_mao_extra:
id: 22
user_id: 193
birthday: "2013-09-30 21:19:25"
brief_introduction: "期待..."
gender: 0
location: "湖南长沙"
occupation: "国防科技大学计算机学院"
work_experience: nil
zip_code: nil
created_at: "2013-09-30 21:19:25"
updated_at: "2013-10-09 19:00:06"
technical_title: "教授"
identity: 0
student_id: nil
teacher_realname: nil
student_realname: nil
location_city: nil
ue_lirongzhen:
id: 587
user_id: 642
birthday: birthday:
brief_introduction: brief_introduction:
gender: 0 gender: 0
location: 河南 location:
occupation:
work_experience:
zip_code:
created_at: 2014-07-29 02:54:09
updated_at: 2014-07-29 02:54:09
technical_title:
identity: 0
student_id:
teacher_realname:
student_realname:
location_city:
school_id:
user_extension_020:
id: 20
user_id: 20
birthday:
brief_introduction: 哈尔
gender: 0
location: 黑龙江
occupation: kylinos-cloud occupation: kylinos-cloud
work_experience: work_experience:
zip_code: zip_code:
created_at: 2014-03-18 14:52:55.000000000 Z created_at: 2014-07-29 02:54:09
updated_at: 2014-03-26 07:19:04.000000000 Z updated_at: 2014-07-29 02:54:09
technical_title: technical_title: 助教
identity: 1 identity: 0
student_id: '14066023' student_id:
teacher_realname: teacher_realname:
student_realname: student_realname:
location_city: 周口 location_city: 哈尔滨
school_id: school_id:
ue_yingang: user_extension_025:
id: 6 id: 25
user_id: 5 user_id: 25
birthday: birthday:
brief_introduction: 现有功能的精细化! brief_introduction: 哈尔
gender: 0 gender: 0
location: 湖南 location: 黑龙江
occupation: 国防科学技术大学计算机学院 occupation: kylinos-cloud
work_experience: work_experience:
zip_code: zip_code:
created_at: 2013-09-24 09:36:12.000000000 Z created_at: 2014-07-29 02:54:09
updated_at: 2014-04-19 08:16:55.000000000 Z updated_at: 2014-07-29 02:54:09
technical_title: 副教授 technical_title: 助教
identity: 0 identity: 1 #student
student_id: '' student_id: 10060342
teacher_realname: teacher_realname:
student_realname: student_realname: 'ue_realname'
location_city: 长沙 location_city: 哈尔滨
school_id: 117 school_id: 117

View File

@ -72,7 +72,7 @@ users_003:
login: dlopper login: dlopper
type: User type: User
users_005: users_005:
id: 12 id: 5
created_on: 2006-07-19 19:33:19 +02:00 created_on: 2006-07-19 19:33:19 +02:00
# Locked # Locked
status: 3 status: 3
@ -165,26 +165,27 @@ groups_011:
id: 11 id: 11
lastname: B Team lastname: B Team
type: Group type: Group
users_yingang_teacher: users_020:
id: 5 id: 20
login: jacknudt login: teacher1
hashed_password: dbbd96684c9a64afe9c4935ce0b517e5e9c08064 # password: foobar
firstname: hashed_password: 6b6095d977621a3071ae2670be95b88092e94b53
lastname: firstname: wang
mail: jack_nudt@163.com lastname: dr
mail: jack_nudt@foo.bar
admin: false admin: false
status: 1 status: 1
last_login_on: 2014-04-27 13:49:18.000000000 Z last_login_on: 2014-07-29 02:54:09
language: zh language: zh
auth_source_id: auth_source_id:
created_on: 2013-06-25 05:20:59.000000000 Z created_on: 2014-07-29 02:54:09
updated_on: 2014-07-16 03:37:51.000000000 Z updated_on: 2014-07-29 02:54:09
type: User type: User
identity_url: identity_url:
mail_notification: only_my_events mail_notification: only_my_events
salt: 92944df2ce4dae1a4f01007263c5d8bb salt: 9db798ee4c462d9614479e6738790891
users_lirongzhen_student: users_025:
id: 642 id: 25
login: lirongzhen login: lirongzhen
hashed_password: 070922b015398577c3ae0d87a68d5ffa93bf82e9 hashed_password: 070922b015398577c3ae0d87a68d5ffa93bf82e9
firstname: 荣振 firstname: 荣振

View File

@ -1,7 +1,18 @@
require File.expand_path('../../test_helper', __FILE__) require File.expand_path('../../test_helper', __FILE__)
class CoursesControllerTest < ActionController::TestCase class CoursesControllerTest < ActionController::TestCase
fixtures :courses, :users, :user_extensions, :roles, :members, :member_roles, :enabled_modules, :boards, :messages fixtures :courses,
:course_infos,
:course_statuses,
:users,
:user_extensions,
:schools,
:roles,
:members,
:member_roles,
:enabled_modules,
:boards,
:messages
def setup def setup
@request.session[:user_id] = nil @request.session[:user_id] = nil
@ -23,7 +34,7 @@ class CoursesControllerTest < ActionController::TestCase
# Get :new # Get :new
# 人员添加课程的权限是不属于任何角色 # 人员添加课程的权限是不属于任何角色
def test_new_course_anyone_temporary def test_new_course_anyone_temporary
@request.session[:user_id] = 5 @request.session[:user_id] = 20
Role.find_by_name("Non member").add_permission! :add_course #Non member Role.find_by_name("Non member").add_permission! :add_course #Non member
get :new get :new
@ -33,7 +44,7 @@ class CoursesControllerTest < ActionController::TestCase
# post :create # post :create
def test_create_course_with_access_control def test_create_course_with_access_control
@request.session[:user_id] = 5 @request.session[:user_id] = 20
Role.find_by_name("Non member").add_permission! :add_course #Non member Role.find_by_name("Non member").add_permission! :add_course #Non member
course_name = 'course_one' course_name = 'course_one'
@ -59,7 +70,7 @@ class CoursesControllerTest < ActionController::TestCase
# post :create 403 # post :create 403
def test_create_course_without_access_control def test_create_course_without_access_control
@request.session[:user_id] = 5 @request.session[:user_id] = 20
#Role.find_by_name("Non member").add_permission! :add_course #Non member #Role.find_by_name("Non member").add_permission! :add_course #Non member
course_name = 'course_one' course_name = 'course_one'