|
|
|
@ -2,6 +2,7 @@ require 'spec_helper' |
|
|
|
|
|
|
|
|
|
require_relative '../../support/pages/ifc_models/show_default' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe 'Create BCF', type: :feature, js: true, with_mail: false do |
|
|
|
|
let(:project) do |
|
|
|
|
FactoryBot.create(:project, types: [type, type_with_cf], work_package_custom_fields: [integer_cf]) |
|
|
|
@ -36,7 +37,7 @@ describe 'Create BCF', type: :feature, js: true, with_mail: false do |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'with all permissions' do |
|
|
|
|
it 'can create a new bcf work package' do |
|
|
|
|
it 'can create a new bcf work package on split page' do |
|
|
|
|
create_page = index_page.create_wp_by_button(type) |
|
|
|
|
|
|
|
|
|
create_page.expect_current_path |
|
|
|
@ -53,14 +54,43 @@ describe 'Create BCF', type: :feature, js: true, with_mail: false do |
|
|
|
|
|
|
|
|
|
create_page.save! |
|
|
|
|
|
|
|
|
|
# TODO: adapt notification message |
|
|
|
|
index_page.expect_and_dismiss_notification( |
|
|
|
|
message: 'Successful creation. Click here to open this work package in fullscreen view.' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
work_package = WorkPackage.last |
|
|
|
|
split_page = ::Pages::SplitWorkPackage.new(work_package, project) |
|
|
|
|
split_page.ensure_page_loaded |
|
|
|
|
split_page.expect_subject |
|
|
|
|
|
|
|
|
|
split_page.close |
|
|
|
|
split_page.expect_closed |
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path /\/bcf\/split$/, ignore_query: true |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'can create on the list view' do |
|
|
|
|
index_page.switch_view 'List' |
|
|
|
|
|
|
|
|
|
create_page = index_page.create_wp_by_button(type) |
|
|
|
|
create_page.view_route = :list |
|
|
|
|
create_page.expect_current_path |
|
|
|
|
create_page.subject_field.set(subject) |
|
|
|
|
create_page.save! |
|
|
|
|
|
|
|
|
|
index_page.expect_and_dismiss_notification( |
|
|
|
|
message: 'Successful creation. Click here to open this work package in fullscreen view.' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
work_package = WorkPackage.last |
|
|
|
|
split_page = ::Pages::SplitWorkPackage.new(work_package, project) |
|
|
|
|
split_page.ensure_page_loaded |
|
|
|
|
split_page.expect_subject |
|
|
|
|
|
|
|
|
|
split_page.close |
|
|
|
|
split_page.expect_closed |
|
|
|
|
|
|
|
|
|
index_page.expect_work_package_listed(work_package) |
|
|
|
|
expect(page).to have_current_path /\/bcf\/list$/, ignore_query: true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|