Project

General

Profile

Actions

Patch #31131

closed

CalendarsControllerTest#test_show fails depending on the date

Added by Mizuki ISHIKAWA almost 5 years ago. Updated almost 5 years ago.

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

0%

Estimated time:

Description

CalendarsControllerTest#test_show failed when running test on 2019/4/1.

Failure:
CalendarsControllerTest#test_show [test/functional/calendars_controller_test.rb:62]:
Expected at least 1 element matching "img[class="gravatar"]", found 0..
Expected 0 to be >= 1.

Steps to reproduce

When test data was created on 2019/4/1, issues_002 was not included in the April calendar.
CalendarsControllerTest#test_show failed because it was dependent on issues_002.

The following changes confirmed that the test was successful.

diff --git a/test/functional/calendars_controller_test.rb b/test/functional/calendars_controller_test.rb
index 69e0053adc..624ae49f67 100644
--- a/test/functional/calendars_controller_test.rb
+++ b/test/functional/calendars_controller_test.rb
@@ -36,6 +36,9 @@ class CalendarsControllerTest < Redmine::ControllerTest
            :users, :email_addresses

   def test_show
+    # for gravatar test
+    Issue.generate!(:start_date => User.current.today, :assigned_to_id => 2)
+
     with_settings :gravatar_enabled => '1' do
       get :show, :params => {
           :project_id => 1

Actions

Also available in: Atom PDF