diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-07 15:51:09 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-07 15:51:09 +0000 |
commit | 068771ea0764e326d720455c87e6c8cbc0f825a3 (patch) | |
tree | a79f34bf8471a43b3d0829507bdfcd8b716eba63 /test/functional | |
parent | e59156b446f1e402c95d04c39374630f2913b611 (diff) | |
download | redmine-068771ea0764e326d720455c87e6c8cbc0f825a3.tar.gz redmine-068771ea0764e326d720455c87e6c8cbc0f825a3.zip |
Refactor: extract TimelogController#new from #edit
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4239 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/timelog_controller_test.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 22d14e32e..823650257 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -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") |