Patch #35413

Add missing fixtures to ActivitiesControllerTest

Added by Yuichi HARADA 4 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:-

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

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


Related issues

Related to Redmine - Defect #34933: Atom feed of the activity page does not contain items aft... Closed

Associated revisions

Revision 21046
Added by Go MAEDA 3 months ago

Add missing fixtures to ActivitiesControllerTest (#34933, #35413).

Patch by Yuichi HARADA.

Revision 21047
Added by Go MAEDA 3 months ago

Merged r21046 from trunk to 4.2-stable (#34933, #35413).

Revision 21048
Added by Go MAEDA 3 months ago

Merged r21046 from trunk to 4.1-stable (#34933, #35413).

History

#1 Updated by Yuichi HARADA 4 months 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

#2 Updated by Yuichi HARADA 4 months 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(

#3 Updated by Go MAEDA 4 months ago

  • Target version set to 5.0.0

Confirmed the issue.

Setting the target version to 5.0.0.

#4 Updated by Go MAEDA 3 months ago

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

#5 Updated by Go MAEDA 3 months ago

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

Committed as a part of #34933.

Also available in: Atom PDF