Commit 113de9c3 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '6571-single-codebase' into 'master'

Extract EE specific files/lines for spec/features/issues_spec.rb

Closes #6571

See merge request gitlab-org/gitlab-ee!10306
parents 48f7cdd9 4732b271
# frozen_string_literal: true
require 'spec_helper'
describe 'Issue weight' do
let(:project) { create(:project, :public) }
it 'shows weight on issue list row' do
create(:issue, project: project, weight: 2)
visit project_issues_path(project)
page.within(first('.issuable-info')) do
expect(page).to have_selector('.issue-weight-icon')
expect(page).to have_content(2)
end
end
it 'allows user to update weight', :js do
user = create(:user)
issue = create(:issue, author: user, project: project)
project.add_developer(user)
sign_in(user)
visit project_issue_path(project, issue)
page.within('.weight') do
expect(page).to have_content "None"
click_link 'Edit'
find('.block.weight input').send_keys 1, :enter
page.within('.value') do
expect(page).to have_content "1"
end
end
end
end
......@@ -57,9 +57,9 @@ describe 'Issues' do
describe 'Edit issue' do
let!(:issue) do
create(:issue,
author: user,
assignees: [user],
project: project)
author: user,
assignees: [user],
project: project)
end
before do
......@@ -75,9 +75,9 @@ describe 'Issues' do
describe 'Editing issue assignee' do
let!(:issue) do
create(:issue,
author: user,
assignees: [user],
project: project)
author: user,
assignees: [user],
project: project)
end
it 'allows user to select unassigned', :js do
......@@ -187,27 +187,16 @@ describe 'Issues' do
expect(page).to have_content 'foobar'
expect(page.all('.no-comments').first.text).to eq "0"
end
it 'shows weight on issue row' do
create(:issue, author: user, project: project, weight: 2)
visit project_issues_path(project)
page.within(first('.issuable-info')) do
expect(page).to have_selector('.issue-weight-icon')
expect(page).to have_content(2)
end
end
end
describe 'Filter issue' do
before do
%w(foobar barbaz gitlab).each do |title|
create(:issue,
author: user,
assignees: [user],
project: project,
title: title)
author: user,
assignees: [user],
project: project,
title: title)
end
@issue = Issue.find_by(title: 'foobar')
......@@ -508,13 +497,20 @@ describe 'Issues' do
it 'allows user to unselect themselves', :js do
issue2 = create(:issue, project: project, author: user)
visit project_issue_path(project, issue2)
def close_dropdown_menu_if_visible
find('.dropdown-menu-toggle', visible: :all).tap do |toggle|
toggle.click if toggle.visible?
end
end
page.within '.assignee' do
click_link 'Edit'
click_link user.name
find('.dropdown-menu-toggle').click
close_dropdown_menu_if_visible
page.within '.value .author' do
expect(page).to have_content user.name
......@@ -523,7 +519,7 @@ describe 'Issues' do
click_link 'Edit'
click_link user.name
find('.dropdown-menu-toggle').click
close_dropdown_menu_if_visible
page.within '.value .assign-yourself' do
expect(page).to have_content "No assignee"
......@@ -549,27 +545,6 @@ describe 'Issues' do
end
end
describe 'update weight from issue#show', :js do
let!(:issue) { create(:issue, project: project) }
before do
visit project_issue_path(project, issue)
end
it 'allows user to update to a weight' do
page.within('.weight') do
expect(page).to have_content "None"
click_link 'Edit'
find('.block.weight input').send_keys 1, :enter
page.within('.value') do
expect(page).to have_content "1"
end
end
end
end
describe 'update milestone from issue#show' do
let!(:issue) { create(:issue, project: project, author: user) }
let!(:milestone) { create(:milestone, project: 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