usercontroller#test
This commit is contained in:
parent
bf9a992399
commit
f18e828632
|
@ -1,11 +1,12 @@
|
||||||
# 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:
|
one:
|
||||||
act_id:
|
id: 1
|
||||||
act_type: MyString
|
act_id: 1
|
||||||
user_id:
|
act_type: JournalsForMessage
|
||||||
|
user_id: 5
|
||||||
|
|
||||||
two:
|
two:
|
||||||
act_id:
|
act_id: 2
|
||||||
act_type: MyString
|
act_type: JournalsForMessage
|
||||||
user_id:
|
user_id: 5
|
||||||
|
|
|
@ -1,4 +1,34 @@
|
||||||
jfm_001:
|
jfm_001:
|
||||||
|
id: 1
|
||||||
|
jour_id: 5
|
||||||
|
jour_type: Principal
|
||||||
|
user_id: 2
|
||||||
|
notes:
|
||||||
|
status: 0
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2014-07-16 15:27:2
|
||||||
|
updated_on: 2014-07-16 15:27:2
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_002:
|
||||||
|
id: 2
|
||||||
|
jour_id: 5
|
||||||
|
jour_type: Principal
|
||||||
|
user_id: 2
|
||||||
|
notes: 我觉得这个系统挺实用,界面挺简洁美观1!
|
||||||
|
status:
|
||||||
|
reply_id: 0
|
||||||
|
created_on: 2014-07-16 15:27:2
|
||||||
|
updated_on: 2014-07-16 15:27:2
|
||||||
|
m_parent_id:
|
||||||
|
is_readed:
|
||||||
|
m_reply_count:
|
||||||
|
m_reply_id:
|
||||||
|
is_comprehensive_evaluation:
|
||||||
|
jfm_045:
|
||||||
id: 45
|
id: 45
|
||||||
jour_id: 2
|
jour_id: 2
|
||||||
jour_type: Project
|
jour_type: Project
|
||||||
|
@ -64,7 +94,7 @@ jfm_060:
|
||||||
jour_id: 2
|
jour_id: 2
|
||||||
jour_type: Project
|
jour_type: Project
|
||||||
user_id: 2
|
user_id: 2
|
||||||
notes: something very nice
|
notes:
|
||||||
status:
|
status:
|
||||||
reply_id: 0
|
reply_id: 0
|
||||||
created_on: 2013-08-21 07:04:43
|
created_on: 2013-08-21 07:04:43
|
||||||
|
@ -119,4 +149,3 @@ jfm_088:
|
||||||
m_reply_count:
|
m_reply_count:
|
||||||
m_reply_id:
|
m_reply_id:
|
||||||
is_comprehensive_evaluation:
|
is_comprehensive_evaluation:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
|
class UsersControllerTest < ActionController::TestCase
|
||||||
|
fixtures :users, :projects, :members, :member_roles, :roles,
|
||||||
|
:custom_fields, :custom_values, :groups_users,
|
||||||
|
:auth_sources,
|
||||||
|
:activities,
|
||||||
|
:journals_for_messages
|
||||||
|
def setup
|
||||||
|
User.current = nil
|
||||||
|
@request.session[:user_id] = 1
|
||||||
|
@request.session[:ctime] = Time.now
|
||||||
|
@request.session[:atime] = Time.now
|
||||||
|
end
|
||||||
|
|
||||||
|
test '#index by non-member' do
|
||||||
|
@request.session[:user_id] = nil
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'index'
|
||||||
|
end
|
||||||
|
|
||||||
|
test '#show by non-member' do
|
||||||
|
@request.session[:user_id] = 8
|
||||||
|
get :show, {id: 5}
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'show'
|
||||||
|
end
|
||||||
|
|
||||||
|
test '#user_newfeedback by non-member' do
|
||||||
|
@request.session[:user_id] = nil
|
||||||
|
get :user_newfeedback, {id: 5}
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'user_newfeedback'
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue