Merged r9740 and r9741 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9754 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -44,6 +44,7 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
# Default activity selected
|
||||
assert_tag :tag => 'option', :attributes => { :selected => 'selected' },
|
||||
:content => 'Development'
|
||||
assert_select 'input[name=project_id][value=1]'
|
||||
end
|
||||
|
||||
def test_get_new_should_only_show_active_time_entry_activities
|
||||
@@ -61,6 +62,18 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
assert_response :success
|
||||
assert_template 'new'
|
||||
assert_tag 'select', :attributes => {:name => 'time_entry[project_id]'}
|
||||
assert_select 'input[name=project_id]', 0
|
||||
end
|
||||
|
||||
def test_new_without_project_should_prefill_the_form
|
||||
@request.session[:user_id] = 3
|
||||
get :new, :time_entry => {:project_id => '1'}
|
||||
assert_response :success
|
||||
assert_template 'new'
|
||||
assert_select 'select[name=?]', 'time_entry[project_id]' do
|
||||
assert_select 'option[value=1][selected=selected]'
|
||||
end
|
||||
assert_select 'input[name=project_id]', 0
|
||||
end
|
||||
|
||||
def test_new_without_project_should_deny_without_permission
|
||||
@@ -144,7 +157,7 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
:spent_on => '2008-03-14',
|
||||
:hours => '7.3'},
|
||||
:continue => '1'
|
||||
assert_redirected_to '/projects/ecookbook/time_entries/new'
|
||||
assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D='
|
||||
end
|
||||
|
||||
def test_create_and_continue_with_issue_id
|
||||
@@ -155,7 +168,7 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
:spent_on => '2008-03-14',
|
||||
:hours => '7.3'},
|
||||
:continue => '1'
|
||||
assert_redirected_to '/projects/ecookbook/issues/1/time_entries/new'
|
||||
assert_redirected_to '/projects/ecookbook/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1'
|
||||
end
|
||||
|
||||
def test_create_and_continue_without_project
|
||||
@@ -167,7 +180,7 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
:hours => '7.3'},
|
||||
:continue => '1'
|
||||
|
||||
assert_redirected_to '/time_entries/new'
|
||||
assert_redirected_to '/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1'
|
||||
end
|
||||
|
||||
def test_create_without_log_time_permission_should_be_denied
|
||||
|
||||
Reference in New Issue
Block a user