diff --git a/spec/features/issues/filter_by_milestone_spec.rb b/spec/features/issues/filter_by_milestone_spec.rb index afefe9d9691..f600f8684ac 100644 --- a/spec/features/issues/filter_by_milestone_spec.rb +++ b/spec/features/issues/filter_by_milestone_spec.rb @@ -3,9 +3,12 @@ require 'rails_helper' feature 'Issue filtering by Milestone', feature: true do include Select2Helper + let(:project) { create(:project, :public) } + let(:milestone) { create(:milestone, project: project) } + scenario 'filters by no Milestone', js: true do - project = create(:project, :public) create(:issue, project: project) + create(:issue, project: project, milestone: milestone) visit_issues(project) filter_by_milestone(Milestone::None.title) @@ -14,9 +17,8 @@ feature 'Issue filtering by Milestone', feature: true do end scenario 'filters by a specific Milestone', js: true do - project = create(:project, :public) - milestone = create(:milestone, project: project) create(:issue, project: project, milestone: milestone) + create(:issue, project: project) visit_issues(project) filter_by_milestone(milestone.title) diff --git a/spec/features/merge_requests/filter_by_milestone_spec.rb b/spec/features/merge_requests/filter_by_milestone_spec.rb index 86b95e6cc29..f70214e1122 100644 --- a/spec/features/merge_requests/filter_by_milestone_spec.rb +++ b/spec/features/merge_requests/filter_by_milestone_spec.rb @@ -3,9 +3,12 @@ require 'rails_helper' feature 'Merge Request filtering by Milestone', feature: true do include Select2Helper + let(:project) { create(:project, :public) } + let(:milestone) { create(:milestone, project: project) } + scenario 'filters by no Milestone', js: true do - project = create(:project, :public) create(:merge_request, :with_diffs, source_project: project) + create(:merge_request, :simple, source_project: project, milestone: milestone) visit_merge_requests(project) filter_by_milestone(Milestone::None.title) @@ -14,9 +17,8 @@ feature 'Merge Request filtering by Milestone', feature: true do end scenario 'filters by a specific Milestone', js: true do - project = create(:project, :public) - milestone = create(:milestone, project: project) create(:merge_request, :with_diffs, source_project: project, milestone: milestone) + create(:merge_request, :simple, source_project: project) visit_merge_requests(project) filter_by_milestone(milestone.title)