Project

General

Profile

Actions

Patch #35413

closed

Add missing fixtures to ActivitiesControllerTest

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

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

0%

Estimated time:

Description

ActivitiesControllerTest has failed.

% RAILS_ENV=test bundle exec rake db:migrate:reset

% RAILS_ENV=test bundle exec rake test TEST=test/functional/activities_controller_test.rb
Run options: --seed 56469

# Running:

.........F

Failure:
ActivitiesControllerTest#test_index_atom_feed_should_respect_feeds_limit_setting [test/functional/activities_controller_test.rb:139]:
Expected exactly 20 elements matching "entry", found 12..
Expected: 20
  Actual: 12

rails test test/functional/activities_controller_test.rb:128

.......

Finished in 2.293125s, 7.4135 runs/s, 24.4208 assertions/s.
17 runs, 56 assertions, 1 failures, 0 errors, 0 skips

Files

35413.patch (625 Bytes) 35413.patch Yuichi HARADA, 2021-06-14 05:00

Related issues

Related to Redmine - Defect #34933: Atom feed of the activity page does not contain items after the second pageClosedGo MAEDA

Actions
Actions #1

Updated by Yuichi HARADA over 3 years ago

The models of Activity are registered in source:trunk/lib/redmine.rb#L420, but some fixtures were not declared in ActivitiesControllerTest.

Redmine::Activity.map do |activity|
  activity.register :issues, :class_name => %w(Issue Journal)
  activity.register :changesets
  activity.register :news
  activity.register :documents, :class_name => %w(Document Attachment)
  activity.register :files, :class_name => 'Attachment'
  activity.register :wiki_edits, :class_name => 'WikiContentVersion', :default => false
  activity.register :messages, :default => false
  activity.register :time_entries, :default => false
end
Actions #2

Updated by Yuichi HARADA over 3 years ago

It was solved with the following patch.

diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index 6bc43da5e..6a722d8a1 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -28,7 +28,8 @@ class ActivitiesControllerTest < Redmine::ControllerTest
            :members,
            :groups_users,
            :enabled_modules,
-           :journals, :journal_details
+           :journals, :journal_details,
+           :attachments, :changesets, :documents, :messages, :news, :time_entries, :wiki_content_versions

   def test_project_index
     get(
Actions #3

Updated by Go MAEDA over 3 years ago

  • Target version set to 5.0.0

Confirmed the issue.

Setting the target version to 5.0.0.

Actions #4

Updated by Go MAEDA over 3 years ago

  • Related to Defect #34933: Atom feed of the activity page does not contain items after the second page added
Actions #5

Updated by Go MAEDA over 3 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version deleted (5.0.0)

Committed as a part of #34933.

Actions

Also available in: Atom PDF