summaryrefslogtreecommitdiff
path: root/spec/helpers/timeboxes_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-29 14:13:29 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-29 14:13:55 +0000
commit9fdc4213b6a4bb8f45d6e65f90047ac742e1c48b (patch)
tree015c539e5b143976dd238e832703da09b92268dd /spec/helpers/timeboxes_helper_spec.rb
parent9ca24e5c1f715a597e694961ac0d60674166039a (diff)
downloadgitlab-ce-9fdc4213b6a4bb8f45d6e65f90047ac742e1c48b.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-10-stable-ee
Diffstat (limited to 'spec/helpers/timeboxes_helper_spec.rb')
-rw-r--r--spec/helpers/timeboxes_helper_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/helpers/timeboxes_helper_spec.rb b/spec/helpers/timeboxes_helper_spec.rb
index e31f2df7372..f9fb40a616b 100644
--- a/spec/helpers/timeboxes_helper_spec.rb
+++ b/spec/helpers/timeboxes_helper_spec.rb
@@ -38,4 +38,23 @@ RSpec.describe TimeboxesHelper do
end
end
end
+
+ describe "#recent_releases_with_counts" do
+ let_it_be(:milestone) { create(:milestone) }
+ let_it_be(:project) { milestone.project }
+ let_it_be(:user) { create(:user) }
+
+ subject { helper.recent_releases_with_counts(milestone, user) }
+
+ before do
+ project.add_developer(user)
+ end
+
+ it "returns releases with counts" do
+ _old_releases = create_list(:release, 2, project: project, milestones: [milestone])
+ recent_public_releases = create_list(:release, 3, project: project, milestones: [milestone], released_at: '2022-01-01T18:00:00Z')
+
+ is_expected.to match([match_array(recent_public_releases), 5, 2])
+ end
+ end
end