Project

General

Profile

Actions

Patch #31964

closed

VersionsControllerTest#test_show randomly fails

Added by Yuichi HARADA over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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

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

Actions
Actions #1

Updated by Go MAEDA over 5 years ago

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

Actions #2

Updated by Yuichi HARADA over 5 years ago

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" 

Actions #3

Updated by Go MAEDA over 5 years ago

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

Updated by Go MAEDA over 5 years ago

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.

Actions #5

Updated by Go MAEDA over 5 years ago

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

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

Actions #6

Updated by Go MAEDA over 5 years ago

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

Also available in: Atom PDF