]> source.dussan.org Git - redmine.git/commitdiff
Test moved to tests with transactional fixtures disabled.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Oct 2012 08:03:19 +0000 (08:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Oct 2012 08:03:19 +0000 (08:03 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10626 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/issues_controller_test.rb
test/functional/issues_controller_transaction_test.rb

index eb8f9c28784e566fc9c86c731c93eb461b5c042a..b897c472e0dd993767727a6c3064b78c81c46e99 100644 (file)
@@ -2871,24 +2871,6 @@ class IssuesControllerTest < ActionController::TestCase
     assert_equal spent_hours_before + 2.5, issue.spent_hours
   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_put_update_with_attachment_only
     set_tmp_attachments_directory
 
index 7e1fa0d004ef1e29cc98d7ffa8727a077836af4e..20a3895ff6fe7ea4053d79d341d21cc4442e4c7e 100644 (file)
@@ -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")