Commit 7e2806a1 authored by Phil Hughes's avatar Phil Hughes

Added tests for setting multiple status on issues

parent 703f7c5d
...@@ -31,7 +31,7 @@ ...@@ -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
......
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
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