Added tests for setting multiple status on issues
This commit is contained in:
parent
703f7c5d57
commit
7e2806a123
|
@ -31,7 +31,7 @@
|
||||||
.issues_bulk_update.hide
|
.issues_bulk_update.hide
|
||||||
= form_tag bulk_update_namespace_project_issues_path(@project.namespace, @project), method: :post do
|
= form_tag bulk_update_namespace_project_issues_path(@project.namespace, @project), method: :post do
|
||||||
.filter-item.inline
|
.filter-item.inline
|
||||||
= dropdown_tag("Status", options: { toggle_class: "js-issue-status", title: "Change status", dropdown_class: "dropdown-menu-selectable", data: { field_name: "update[state_event]" } } ) do
|
= dropdown_tag("Status", options: { toggle_class: "js-issue-status", title: "Change status", dropdown_class: "dropdown-menu-status dropdown-menu-selectable", data: { field_name: "update[state_event]" } } ) do
|
||||||
%ul
|
%ul
|
||||||
%li
|
%li
|
||||||
%a{href: "#", data: {id: "reopen"}} Open
|
%a{href: "#", data: {id: "reopen"}} Open
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
feature 'Multiple issue updating from issues#index', feature: true do
|
||||||
|
let!(:project) { create(:project) }
|
||||||
|
let!(:issue) { create(:issue, project: project) }
|
||||||
|
let!(:user) { create(:user)}
|
||||||
|
|
||||||
|
context 'status update', js: true do
|
||||||
|
before do
|
||||||
|
project.team << [user, :master]
|
||||||
|
login_as(user)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should be set to closed' do
|
||||||
|
visit namespace_project_issues_path(project.namespace, project)
|
||||||
|
|
||||||
|
find('#check_all_issues').click
|
||||||
|
find('.js-issue-status').click
|
||||||
|
|
||||||
|
find('.dropdown-menu-status a', text: 'Closed').click
|
||||||
|
click_update_issues_button
|
||||||
|
expect(page).to have_selector('.issue', count: 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should be set to open' do
|
||||||
|
create_closed
|
||||||
|
visit namespace_project_issues_path(project.namespace, project)
|
||||||
|
|
||||||
|
find('.issues-state-filters a', text: 'Closed').click
|
||||||
|
|
||||||
|
find('#check_all_issues').click
|
||||||
|
find('.js-issue-status').click
|
||||||
|
|
||||||
|
find('.dropdown-menu-status a', text: 'Open').click
|
||||||
|
click_update_issues_button
|
||||||
|
expect(page).to have_selector('.issue', count: 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_closed
|
||||||
|
create(:issue, project: project, state: :closed)
|
||||||
|
end
|
||||||
|
|
||||||
|
def click_update_issues_button
|
||||||
|
find('.update_selected_issues').click
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue