Project

General

Profile

Actions

Patch #31964

closed

VersionsControllerTest#test_show randomly fails

Patch #31964: VersionsControllerTest#test_show randomly fails

Added by Yuichi HARADA about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
-

Description

Failure:
VersionsControllerTest#test_show [test/functional/versions_controller_test.rb:125]:
Expected exactly 0 elements matching "img.gravatar", found 1..
Expected: 0
  Actual: 1

bin/rails test test/functional/versions_controller_test.rb:117

Solved by the following patch.

diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index 358b6f8c0..8981c6932 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -115,14 +115,16 @@ class VersionsControllerTest < Redmine::ControllerTest
   end

   def test_show
-    get :show, :params => {:id => 2}
-    assert_response :success
+    with_settings :gravatar_enabled => '0' do
+      get :show, :params => {:id => 2}
+      assert_response :success

-    assert_select 'h2', :text => /1.0/
-    assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked'
+      assert_select 'h2', :text => /1.0/
+      assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked'

-    # no issue avatar when gravatar is disabled
-    assert_select 'img.gravatar', :count => 0
+      # no issue avatar when gravatar is disabled
+      assert_select 'img.gravatar', :count => 0
+    end
   end

   def test_show_should_show_issue_assignee


Related issues 1 (0 open — 1 closed)

Related to Redmine - Patch #28510: Show issue assignee gravatar in roadmap and version pageClosedGo MAEDAActions

Updated by Go MAEDA about 7 years ago Actions #1

Thank you for reporting this issue. Could you tell me the run option of bin/rails test to reproduce the error?

Updated by Yuichi HARADA about 7 years ago Actions #2

Go MAEDA wrote:

Thank you for reporting this issue. Could you tell me the run option of bin/rails test to reproduce the error?

Sorry for the lack of explanation.
You can reproduce it with the following command:

$ RAILS_ENV=test bundle exec rake test TESTOPTS="--seed 41050" 

Updated by Go MAEDA about 7 years ago Actions #3

  • Related to Patch #28510: Show issue assignee gravatar in roadmap and version page added

Updated by Go MAEDA about 7 years ago Actions #4

Although I could not reproduce the error even with "--seed 41050" option, I understand that we have to set gravatar_enabled to 0 in the test.

Updated by Go MAEDA about 7 years ago Actions #5

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the fix as a part of #28510. Thanks.

Updated by Go MAEDA about 7 years ago Actions #6

  • Subject changed from VersionsControllerTest#test_show failed to VersionsControllerTest#test_show randomly fails
Actions

Also available in: PDF Atom