2016-10-26 13:34:06 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
feature 'Group issues page' do
|
2017-08-02 05:27:24 -04:00
|
|
|
include FilteredSearchHelpers
|
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'with shared examples' do
|
|
|
|
let(:path) { issues_group_path(group) }
|
|
|
|
let(:issuable) { create(:issue, project: project, title: "this is my created issuable")}
|
2016-10-26 13:34:06 -04:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
include_examples 'project features apply to issuables', Issue
|
2017-02-28 15:50:57 -05:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'rss feed' do
|
|
|
|
let(:access_level) { ProjectFeature::ENABLED }
|
2017-02-28 15:50:57 -05:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'when signed in' do
|
|
|
|
let(:user) { user_in_group }
|
2017-02-28 15:50:57 -05:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
it_behaves_like "it has an RSS button with current_user's RSS token"
|
|
|
|
it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
|
|
|
|
end
|
2017-02-28 15:50:57 -05:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'when signed out' do
|
|
|
|
let(:user) { nil }
|
2017-02-28 15:50:57 -05:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
it_behaves_like "it has an RSS button without an RSS token"
|
|
|
|
it_behaves_like "an autodiscoverable RSS feed without an RSS token"
|
|
|
|
end
|
2017-02-28 15:50:57 -05:00
|
|
|
end
|
2017-04-24 11:15:24 -04:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'assignee', :js do
|
|
|
|
let(:access_level) { ProjectFeature::ENABLED }
|
|
|
|
let(:user) { user_in_group }
|
|
|
|
let(:user2) { user_outside_group }
|
|
|
|
let(:path) { issues_group_path(group) }
|
|
|
|
|
|
|
|
it 'filters by only group users' do
|
|
|
|
filtered_search.set('assignee:')
|
2017-04-24 11:15:24 -04:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
expect(find('#js-dropdown-assignee .filter-dropdown')).to have_content(user.name)
|
|
|
|
expect(find('#js-dropdown-assignee .filter-dropdown')).not_to have_content(user2.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-04-24 11:15:24 -04:00
|
|
|
|
2018-01-24 01:06:24 -05:00
|
|
|
context 'issues list', :nested_groups do
|
|
|
|
let(:group) { create(:group)}
|
|
|
|
let(:subgroup) { create(:group, parent: group) }
|
|
|
|
let(:project) { create(:project, :public, group: group)}
|
|
|
|
let(:subgroup_project) { create(:project, :public, group: subgroup)}
|
|
|
|
let!(:issue) { create(:issue, project: project, title: 'root group issue') }
|
|
|
|
let!(:subgroup_issue) { create(:issue, project: subgroup_project, title: 'subgroup issue') }
|
|
|
|
|
|
|
|
it 'returns all group and subgroup issues' do
|
|
|
|
visit issues_group_path(group)
|
|
|
|
|
|
|
|
page.within('.issuable-list') do
|
|
|
|
expect(page).to have_selector('li.issue', count: 2)
|
|
|
|
expect(page).to have_content('root group issue')
|
|
|
|
expect(page).to have_content('subgroup issue')
|
|
|
|
end
|
2017-04-24 11:15:24 -04:00
|
|
|
end
|
|
|
|
end
|
2016-10-26 13:34:06 -04:00
|
|
|
end
|