summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_transaction_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-13 08:03:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-13 08:03:19 +0000
commit31ee1d22eb89c6b4debac8307e84022a7dd23bc5 (patch)
tree0daded266018b586e0c55c4f467a01ecd5188f32 /test/functional/issues_controller_transaction_test.rb
parent9af6141c9161c1b337ec1e945efe8960e55e845e (diff)
downloadredmine-31ee1d22eb89c6b4debac8307e84022a7dd23bc5.tar.gz
redmine-31ee1d22eb89c6b4debac8307e84022a7dd23bc5.zip
Test moved to tests with transactional fixtures disabled.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10626 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_transaction_test.rb')
-rw-r--r--test/functional/issues_controller_transaction_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb
index 7e1fa0d00..20a3895ff 100644
--- a/test/functional/issues_controller_transaction_test.rb
+++ b/test/functional/issues_controller_transaction_test.rb
@@ -235,6 +235,24 @@ class IssuesControllerTransactionTest < ActionController::TestCase
assert_nil issue.fixed_version_id
end
+ def test_put_update_with_spent_time_and_failure_should_not_add_spent_time
+ @request.session[:user_id] = 2
+
+ assert_no_difference('TimeEntry.count') do
+ put :update,
+ :id => 1,
+ :issue => { :subject => '' },
+ :time_entry => { :hours => '2.5', :comments => 'should not be added', :activity_id => TimeEntryActivity.first.id }
+ assert_response :success
+ end
+
+ assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2.5'
+ assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'should not be added'
+ assert_select 'select[name=?]', 'time_entry[activity_id]' do
+ assert_select 'option[value=?][selected=selected]', TimeEntryActivity.first.id
+ end
+ end
+
def test_index_should_rescue_invalid_sql_query
Query.any_instance.stubs(:statement).returns("INVALID STATEMENT")