diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
commit | aa542224bb345acf0cb9a1a606f0a802c16b0336 (patch) | |
tree | 496540a29aec55c6faeec7b0140824547046ae6c /spec/features/milestones | |
parent | 2494b608a460c46c759ad84bb29e6cc3447499a1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/milestones')
-rw-r--r-- | spec/features/milestones/user_views_milestones_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/features/milestones/user_views_milestones_spec.rb b/spec/features/milestones/user_views_milestones_spec.rb index 0b51ca12997..09378cab5e3 100644 --- a/spec/features/milestones/user_views_milestones_spec.rb +++ b/spec/features/milestones/user_views_milestones_spec.rb @@ -34,4 +34,31 @@ describe "User views milestones" do .and have_content(closed_issue.title) end end + + context "with associated releases" do + set(:first_release) { create(:release, project: project, name: "The first release", milestones: [milestone], released_at: Time.zone.parse('2019-10-07')) } + + context "with a single associated release" do + it "shows the associated release" do + expect(page).to have_content("Release #{first_release.name}") + expect(page).to have_link(first_release.name, href: project_releases_path(project, anchor: first_release.tag)) + end + end + + context "with lots of associated releases" do + set(:second_release) { create(:release, project: project, name: "The second release", milestones: [milestone], released_at: first_release.released_at + 1.day) } + set(:third_release) { create(:release, project: project, name: "The third release", milestones: [milestone], released_at: second_release.released_at + 1.day) } + set(:fourth_release) { create(:release, project: project, name: "The fourth release", milestones: [milestone], released_at: third_release.released_at + 1.day) } + set(:fifth_release) { create(:release, project: project, name: "The fifth release", milestones: [milestone], released_at: fourth_release.released_at + 1.day) } + + it "shows the associated releases and the truncation text" do + expect(page).to have_content("Releases #{fifth_release.name} • #{fourth_release.name} • #{third_release.name} • 2 more releases") + + expect(page).to have_link(fifth_release.name, href: project_releases_path(project, anchor: fifth_release.tag)) + expect(page).to have_link(fourth_release.name, href: project_releases_path(project, anchor: fourth_release.tag)) + expect(page).to have_link(third_release.name, href: project_releases_path(project, anchor: third_release.tag)) + expect(page).to have_link("2 more releases", href: project_releases_path(project)) + end + end + end end |