Refactor: extract TimelogController#new from #edit
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4239 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -31,9 +31,9 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
def test_get_edit
|
||||
def test_get_new
|
||||
@request.session[:user_id] = 3
|
||||
get :edit, :project_id => 1
|
||||
get :new, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
# Default activity selected
|
||||
@@ -41,6 +41,15 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
:content => 'Development'
|
||||
end
|
||||
|
||||
def test_get_new_should_only_show_active_time_entry_activities
|
||||
@request.session[:user_id] = 3
|
||||
get :new, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
assert_no_tag :tag => 'option', :content => 'Inactive Activity'
|
||||
|
||||
end
|
||||
|
||||
def test_get_edit_existing_time
|
||||
@request.session[:user_id] = 2
|
||||
get :edit, :id => 2, :project_id => nil
|
||||
@@ -50,15 +59,6 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/timelog/edit/2' }
|
||||
end
|
||||
|
||||
def test_get_edit_should_only_show_active_time_entry_activities
|
||||
@request.session[:user_id] = 3
|
||||
get :edit, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
assert_no_tag :tag => 'option', :content => 'Inactive Activity'
|
||||
|
||||
end
|
||||
|
||||
def test_get_edit_with_an_existing_time_entry_with_inactive_activity
|
||||
te = TimeEntry.find(1)
|
||||
te.activity = TimeEntryActivity.find_by_name("Inactive Activity")
|
||||
|
||||
Reference in New Issue
Block a user