Commit b41a274b authored by Rubén Dávila's avatar Rubén Dávila

Don't list merge requests from archived projects in Group view.

parent 0b86b46a
...@@ -2,7 +2,7 @@ module MergeRequestsAction ...@@ -2,7 +2,7 @@ module MergeRequestsAction
extend ActiveSupport::Concern extend ActiveSupport::Concern
def merge_requests def merge_requests
@merge_requests = get_merge_requests_collection @merge_requests = get_merge_requests_collection.non_archived
@merge_requests = @merge_requests.page(params[:page]).per(ApplicationController::PER_PAGE) @merge_requests = @merge_requests.page(params[:page]).per(ApplicationController::PER_PAGE)
@merge_requests = @merge_requests.preload(:author, :target_project) @merge_requests = @merge_requests.preload(:author, :target_project)
......
...@@ -33,6 +33,12 @@ Feature: Groups ...@@ -33,6 +33,12 @@ Feature: Groups
When I visit group "Owned" merge requests page When I visit group "Owned" merge requests page
Then I should see merge requests from group "Owned" assigned to me Then I should see merge requests from group "Owned" assigned to me
Scenario: I should not see merge requests from archived project in "Owned" group merge requests list
Given Group "Owned" has archived project
And the archived project have some merge_requests
When I visit group "Owned" merge requests page
Then I should not see merge requests from the archived project
Scenario: I should see edit group "Owned" page Scenario: I should see edit group "Owned" page
When I visit group "Owned" settings page When I visit group "Owned" settings page
And I change group "Owned" name to "new-name" And I change group "Owned" name to "new-name"
......
...@@ -50,6 +50,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -50,6 +50,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end end
end end
step 'I should not see merge requests from the archived project' do
@archived_project.merge_requests.each do |mr|
expect(page).not_to have_content mr.title
end
end
step 'I should see merge requests from group "Owned" assigned to me' do step 'I should see merge requests from group "Owned" assigned to me' do
assigned_to_me(:merge_requests).each do |issue| assigned_to_me(:merge_requests).each do |issue|
expect(page).to have_content issue.title[0..80] expect(page).to have_content issue.title[0..80]
...@@ -137,6 +143,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -137,6 +143,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
author: current_user author: current_user
end end
step 'the archived project have some merge requests' do
create :merge_request,
source_project: @archived_project,
target_project: @archived_project,
assignee: current_user,
author: current_user
end
private private
def assigned_to_me(key) def assigned_to_me(key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment