From ff7fe2d12dec6c76b5a90b2c95cca81152cc5d42 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Tue, 6 Jun 2017 15:53:31 -0300 Subject: Remove Drag and drop and sorting from milestone view --- spec/features/milestones/milestones_spec.rb | 153 ++++++++++++++-------------- 1 file changed, 76 insertions(+), 77 deletions(-) (limited to 'spec/features') diff --git a/spec/features/milestones/milestones_spec.rb b/spec/features/milestones/milestones_spec.rb index c8a4d23f695..1537b0f472a 100644 --- a/spec/features/milestones/milestones_spec.rb +++ b/spec/features/milestones/milestones_spec.rb @@ -1,109 +1,108 @@ -require 'rails_helper' +# require 'rails_helper' -describe 'Milestone draggable', feature: true, js: true do - include DragTo +# describe 'Milestone draggable', feature: true, js: true do +# include DragTo - let(:milestone) { create(:milestone, project: project, title: 8.14) } - let(:project) { create(:empty_project, :public) } - let(:user) { create(:user) } +# let(:milestone) { create(:milestone, project: project, title: 8.14) } +# let(:project) { create(:empty_project, :public) } +# let(:user) { create(:user) } - context 'issues' do - let(:issue) { page.find_by_id('issues-list-unassigned').find('li') } - let(:issue_target) { page.find_by_id('issues-list-ongoing') } +# context 'issues' do +# let(:issue) { page.find_by_id('issues-list-unassigned').find('li') } +# let(:issue_target) { page.find_by_id('issues-list-ongoing') } - it 'does not allow guest to drag issue' do - create_and_drag_issue +# it 'does not allow guest to drag issue' do +# create_and_drag_issue - expect(issue_target).not_to have_selector('.issuable-row') - end +# expect(issue_target).not_to have_selector('.issuable-row') +# end - it 'does not allow authorized user to drag issue' do - login_as(user) - create_and_drag_issue +# it 'does not allow authorized user to drag issue' do +# login_as(user) +# create_and_drag_issue - expect(issue_target).not_to have_selector('.issuable-row') - end +# expect(issue_target).not_to have_selector('.issuable-row') +# end - it 'allows author to drag issue' do - login_as(user) - create_and_drag_issue(author: user) +# it 'allows author to drag issue' do +# login_as(user) +# create_and_drag_issue(author: user) - expect(issue_target).to have_selector('.issuable-row') - end +# expect(issue_target).to have_selector('.issuable-row') +# end - it 'allows admin to drag issue' do - login_as(:admin) - create_and_drag_issue +# it 'allows admin to drag issue' do +# login_as(:admin) - expect(issue_target).to have_selector('.issuable-row') - end +# create_and_drag_issue - it 'assigns issue when it has been dragged to ongoing list' do - login_as(:admin) - create_and_drag_issue +# expect(issue_target).to have_selector('.issuable-row') +# end +# end +>>>>>>> Remove Drag and drop and sorting from milestone view - expect(@issue.reload.assignees).not_to be_empty - expect(page).to have_selector("#sortable_issue_#{@issue.iid} .assignee-icon img", count: 1) - end - end +# context 'merge requests' do +# let(:merge_request) { page.find_by_id('merge_requests-list-unassigned').find('li') } +# let(:merge_request_target) { page.find_by_id('merge_requests-list-ongoing') } - context 'merge requests' do - let(:merge_request) { page.find_by_id('merge_requests-list-unassigned').find('li') } - let(:merge_request_target) { page.find_by_id('merge_requests-list-ongoing') } +# it 'does not allow guest to drag merge request' do +# create_and_drag_merge_request - it 'does not allow guest to drag merge request' do - create_and_drag_merge_request +# expect(merge_request_target).not_to have_selector('.issuable-row') +# end - expect(merge_request_target).not_to have_selector('.issuable-row') - end +# it 'does not allow authorized user to drag merge request' do +# login_as(user) +# create_and_drag_merge_request - it 'does not allow authorized user to drag merge request' do - login_as(user) - create_and_drag_merge_request +# expect(merge_request_target).not_to have_selector('.issuable-row') +# end - expect(merge_request_target).not_to have_selector('.issuable-row') - end +# it 'allows author to drag merge request' do +# login_as(user) +# create_and_drag_merge_request(author: user) - it 'allows author to drag merge request' do - login_as(user) - create_and_drag_merge_request(author: user) +# expect(merge_request_target).to have_selector('.issuable-row') +# end - expect(merge_request_target).to have_selector('.issuable-row') - end +# it 'allows admin to drag merge request' do +# login_as(:admin) +# create_and_drag_merge_request - it 'allows admin to drag merge request' do - login_as(:admin) - create_and_drag_merge_request - - expect(merge_request_target).to have_selector('.issuable-row') - end - end +# expect(merge_request_target).to have_selector('.issuable-row') +# end +# end +<<<<<<< 5f42009f8dcc29d559ee415e92c88858e361f063 def create_and_drag_issue(params = {}) @issue = create(:issue, params.merge(title: 'Foo', project: project, milestone: milestone)) +======= +# def create_and_drag_issue(params = {}) +# create(:issue, params.merge(title: 'Foo', project: project, milestone: milestone)) +>>>>>>> Remove Drag and drop and sorting from milestone view - visit namespace_project_milestone_path(project.namespace, project, milestone) - scroll_into_view('.milestone-content') - drag_to(selector: '.issues-sortable-list', list_to_index: 1) +# visit namespace_project_milestone_path(project.namespace, project, milestone) +# scroll_into_view('.milestone-content') +# drag_to(selector: '.issues-sortable-list', list_to_index: 1) - wait_for_requests - end +# wait_for_requests +# end - def create_and_drag_merge_request(params = {}) - create(:merge_request, params.merge(title: 'Foo', source_project: project, target_project: project, milestone: milestone)) +# def create_and_drag_merge_request(params = {}) +# create(:merge_request, params.merge(title: 'Foo', source_project: project, target_project: project, milestone: milestone)) - visit namespace_project_milestone_path(project.namespace, project, milestone) - page.find("a[href='#tab-merge-requests']").click +# visit namespace_project_milestone_path(project.namespace, project, milestone) +# page.find("a[href='#tab-merge-requests']").click - wait_for_requests +# wait_for_requests - scroll_into_view('.milestone-content') - drag_to(selector: '.merge_requests-sortable-list', list_to_index: 1) +# scroll_into_view('.milestone-content') +# drag_to(selector: '.merge_requests-sortable-list', list_to_index: 1) - wait_for_requests - end +# wait_for_requests +# end - def scroll_into_view(selector) - page.evaluate_script("document.querySelector('#{selector}').scrollIntoView();") - end -end +# def scroll_into_view(selector) +# page.evaluate_script("document.querySelector('#{selector}').scrollIntoView();") +# end +# end -- cgit v1.2.1