Commit 6a199ab8 authored by Sean McGivern's avatar Sean McGivern

Merge branch '4185-spec-failure' into 'master'

Add additional spec and assertions for epis_issues

See merge request gitlab-org/gitlab-ee!3601
parents dcfc2491 6cf8378d
......@@ -43,6 +43,17 @@ describe 'Epic Issues', :js do
end
context 'when user is a group member' do
let(:issue_to_add) { create(:issue, project: private_project) }
let(:issue_invalid) { create(:issue) }
def add_issues(references)
find('.related-issues-block h3.panel-title button').click
find('.js-add-issuable-form-input').set(references)
find('.js-add-issuable-form-add-button').click
wait_for_requests
end
before do
group.add_developer(user)
visit_epic
......@@ -64,16 +75,20 @@ describe 'Epic Issues', :js do
end
end
it 'user cannot add new issues to the epic from another group' do
add_issues("#{issue_invalid.to_reference(full: true)}")
expect(page).to have_selector('.content-wrapper .alert-wrapper .flash-text')
expect(find('.flash-alert')).to have_text('No Issue found for given params')
end
it 'user can add new issues to the epic' do
issue_to_add = create(:issue, project: private_project)
issue_invalid = create(:issue)
references = "#{issue_to_add.to_reference(full: true)} #{issue_invalid.to_reference(full: true)}"
find('.related-issues-block h3.panel-title button').click
find('.js-add-issuable-form-input').set references
find('.js-add-issuable-form-add-button').click
add_issues(references)
wait_for_requests
expect(page).not_to have_selector('.content-wrapper .alert-wrapper .flash-text')
expect(page).not_to have_content('No Issue found for given params')
within('.related-issues-block ul.issuable-list') do
expect(page).to have_selector('li', count: 3)
......
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