Commit e571cbaa authored by Douwe Maan's avatar Douwe Maan

Merge branch 'gt-update-activity-filter-for-issues' into 'master'

Update activity filter for issues

Closes #53334

See merge request gitlab-org/gitlab-ce!23423
parents 45b3c542 f40aecdd
---
title: Update activity filter for issues
merge_request: 23423
author: George Tsiolis
type: changed
......@@ -33,7 +33,7 @@ class EventFilter
when TEAM
events.where(action: [Event::JOINED, Event::LEFT, Event::EXPIRED])
when ISSUE
events.where(action: [Event::CREATED, Event::UPDATED, Event::CLOSED, Event::REOPENED])
events.where(action: [Event::CREATED, Event::UPDATED, Event::CLOSED, Event::REOPENED], target_type: 'Issue')
else
events
end
......
......@@ -39,6 +39,8 @@ describe 'Dashboard > Activity' do
event
end
let(:issue) { create(:issue, project: project) }
let!(:merged_event) do
create(:event, :merged, project: project, target: merge_request, author: user)
end
......@@ -59,6 +61,10 @@ describe 'Dashboard > Activity' do
create(:event, :closed, project: project, target: milestone, author: user)
end
let!(:issue_event) do
create(:event, :created, project: project, target: issue, author: user)
end
before do
project.add_maintainer(user)
......@@ -74,6 +80,7 @@ describe 'Dashboard > Activity' do
expect(page).to have_content('closed')
expect(page).to have_content('commented on')
expect(page).to have_content('closed milestone')
expect(page).to have_content('opened issue')
end
end
......@@ -87,6 +94,7 @@ describe 'Dashboard > Activity' do
expect(page).not_to have_content('accepted')
expect(page).not_to have_content('closed')
expect(page).not_to have_content('commented on')
expect(page).not_to have_content('opened issue')
end
end
......@@ -100,6 +108,7 @@ describe 'Dashboard > Activity' do
expect(page).to have_content('accepted')
expect(page).not_to have_content('closed')
expect(page).not_to have_content('commented on')
expect(page).not_to have_content('opened issue')
end
end
......@@ -111,9 +120,10 @@ describe 'Dashboard > Activity' do
expect(page).not_to have_content('pushed new branch')
expect(page).not_to have_content('joined')
expect(page).not_to have_content('accepted')
expect(page).to have_content('closed')
expect(page).not_to have_content('closed')
expect(page).not_to have_content('commented on')
expect(page).to have_content('closed milestone')
expect(page).not_to have_content('closed milestone')
expect(page).to have_content('opened issue')
end
end
......@@ -127,6 +137,7 @@ describe 'Dashboard > Activity' do
expect(page).not_to have_content('accepted')
expect(page).not_to have_content('closed')
expect(page).to have_content('commented on')
expect(page).not_to have_content('opened issue')
end
end
......@@ -140,6 +151,7 @@ describe 'Dashboard > Activity' do
expect(page).not_to have_content('accepted')
expect(page).not_to have_content('closed')
expect(page).not_to have_content('commented on')
expect(page).not_to have_content('opened issue')
end
end
......@@ -155,6 +167,7 @@ describe 'Dashboard > Activity' do
expect(page).not_to have_content('accepted')
expect(page).not_to have_content('closed')
expect(page).not_to have_content('commented on')
expect(page).not_to have_content('opened issue')
end
end
end
......
......@@ -26,10 +26,10 @@ describe EventFilter do
set(:push_event) { create(:push_event, project: public_project) }
set(:merged_event) { create(:event, :merged, project: public_project, target: public_project) }
set(:created_event) { create(:event, :created, project: public_project, target: public_project) }
set(:updated_event) { create(:event, :updated, project: public_project, target: public_project) }
set(:closed_event) { create(:event, :closed, project: public_project, target: public_project) }
set(:reopened_event) { create(:event, :reopened, project: public_project, target: public_project) }
set(:created_event) { create(:event, :created, project: public_project, target: create(:issue, project: public_project)) }
set(:updated_event) { create(:event, :updated, project: public_project, target: create(:issue, project: public_project)) }
set(:closed_event) { create(:event, :closed, project: public_project, target: create(:issue, project: public_project)) }
set(:reopened_event) { create(:event, :reopened, project: public_project, target: create(:issue, project: public_project)) }
set(:comments_event) { create(:event, :commented, project: public_project, target: public_project) }
set(:joined_event) { create(:event, :joined, project: public_project, target: public_project) }
set(:left_event) { create(:event, :left, project: public_project, target: public_project) }
......
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