Project

General

Profile

Actions

Patch #31964

closed

VersionsControllerTest#test_show randomly fails

Added by Yuichi HARADA about 5 years ago. Updated about 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

Also available in: Atom PDF