Commit fcdb5a72 authored by Clement Ho's avatar Clement Ho

Add feature spec

parent eefcb9ab
require 'spec_helper'
describe 'Epic Issues', :js do
include DragTo
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:epic) { create(:epic, group: group) }
......@@ -40,6 +42,10 @@ describe 'Epic Issues', :js do
it 'user cannot add new issues to the epic' do
expect(page).not_to have_selector('.related-issues-block h3.panel-title button')
end
it 'user cannot reorder issues in epic' do
expect(page).not_to have_selector('.js-related-issues-token-list-item.user-can-drag')
end
end
context 'when user is a group member' do
......@@ -95,5 +101,15 @@ describe 'Epic Issues', :js do
expect(page).to have_content(issue_to_add.title)
end
end
it 'user can reorder issues in epic' do
expect(first('.js-related-issues-token-list-item')).to have_content(public_issue.title)
expect(page.all('.js-related-issues-token-list-item').last).to have_content(private_issue.title)
drag_to(selector: '.issuable-list', to_index: 1)
expect(first('.js-related-issues-token-list-item')).to have_content(private_issue.title)
expect(page.all('.js-related-issues-token-list-item').last).to have_content(public_issue.title)
end
end
end
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