mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 09:16:02 +01:00
fix source indent of TimelogControllerTest
git-svn-id: http://svn.redmine.org/redmine/trunk@20182 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -233,16 +233,20 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
def test_post_create
|
def test_post_create
|
||||||
@request.session[:user_id] = 3
|
@request.session[:user_id] = 3
|
||||||
assert_difference 'TimeEntry.count' do
|
assert_difference 'TimeEntry.count' do
|
||||||
post :create, :params => {
|
post(
|
||||||
:project_id => 1,
|
:create,
|
||||||
:time_entry => {:comments => 'Some work on TimelogControllerTest',
|
:params => {
|
||||||
# Not the default activity
|
:project_id => 1,
|
||||||
:activity_id => '11',
|
:time_entry => {
|
||||||
:spent_on => '2008-03-14',
|
:comments => 'Some work on TimelogControllerTest',
|
||||||
:issue_id => '1',
|
# Not the default activity
|
||||||
:hours => '7.3'
|
:activity_id => '11',
|
||||||
|
:spent_on => '2008-03-14',
|
||||||
|
:issue_id => '1',
|
||||||
|
:hours => '7.3'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
assert_redirected_to '/projects/ecookbook/time_entries'
|
assert_redirected_to '/projects/ecookbook/time_entries'
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -363,19 +367,21 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
def test_create_for_other_user
|
def test_create_for_other_user
|
||||||
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
|
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
|
post(
|
||||||
post :create, :params => {
|
:create,
|
||||||
:project_id => 1,
|
:params => {
|
||||||
:time_entry => {:comments => 'Some work on TimelogControllerTest',
|
:project_id => 1,
|
||||||
# Not the default activity
|
:time_entry => {
|
||||||
:activity_id => '11',
|
:comments => 'Some work on TimelogControllerTest',
|
||||||
:spent_on => '2008-03-14',
|
# Not the default activity
|
||||||
:issue_id => '1',
|
:activity_id => '11',
|
||||||
:hours => '7.3',
|
:spent_on => '2008-03-14',
|
||||||
:user_id => '3'
|
:issue_id => '1',
|
||||||
|
:hours => '7.3',
|
||||||
|
:user_id => '3'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
assert_redirected_to '/projects/ecookbook/time_entries'
|
assert_redirected_to '/projects/ecookbook/time_entries'
|
||||||
|
|
||||||
t = TimeEntry.last
|
t = TimeEntry.last
|
||||||
@@ -386,19 +392,21 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
def test_create_for_other_user_should_fail_without_permission
|
def test_create_for_other_user_should_fail_without_permission
|
||||||
Role.find_by_name('Manager').remove_permission! :log_time_for_other_users
|
Role.find_by_name('Manager').remove_permission! :log_time_for_other_users
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
|
post(
|
||||||
post :create, :params => {
|
:create,
|
||||||
:project_id => 1,
|
:params => {
|
||||||
:time_entry => {:comments => 'Some work on TimelogControllerTest',
|
:project_id => 1,
|
||||||
# Not the default activity
|
:time_entry => {
|
||||||
:activity_id => '11',
|
:comments => 'Some work on TimelogControllerTest',
|
||||||
:spent_on => '2008-03-14',
|
# Not the default activity
|
||||||
:issue_id => '1',
|
:activity_id => '11',
|
||||||
:hours => '7.3',
|
:spent_on => '2008-03-14',
|
||||||
:user_id => '3'
|
:issue_id => '1',
|
||||||
|
:hours => '7.3',
|
||||||
|
:user_id => '3'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select_error /User is invalid/
|
assert_select_error /User is invalid/
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user