Commit 4732b271 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Move EE-specific tests to separate file

Extracts tests related to issue weight into a separate file
parent ba47c0da
# 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
......@@ -187,17 +187,6 @@ 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
......@@ -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