kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.6 KiB
68 lines
2.6 KiB
7 years ago
|
#-- copyright
|
||
5 years ago
|
# OpenProject is an open source project management software.
|
||
|
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||
7 years ago
|
#
|
||
5 years ago
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License version 3.
|
||
|
#
|
||
|
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
# Copyright (C) 2010-2013 the ChiliProject Team
|
||
7 years ago
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License
|
||
5 years ago
|
# as published by the Free Software Foundation; either version 2
|
||
|
# of the License, or (at your option) any later version.
|
||
7 years ago
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
5 years ago
|
#
|
||
|
# See docs/COPYRIGHT.rdoc for more details.
|
||
7 years ago
|
#++
|
||
|
|
||
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
||
|
|
||
4 years ago
|
describe 'Work Package budget fields', type: :feature, js: true do
|
||
7 years ago
|
let(:type_task) { FactoryBot.create(:type_task) }
|
||
|
let!(:status) { FactoryBot.create(:status, is_default: true) }
|
||
|
let!(:priority) { FactoryBot.create(:priority, is_default: true) }
|
||
5 years ago
|
let!(:project) { FactoryBot.create(:project, types: [type_task]) }
|
||
7 years ago
|
let(:user) { FactoryBot.create :admin }
|
||
4 years ago
|
let!(:budget) { FactoryBot.create :budget, author: user, project: project }
|
||
7 years ago
|
|
||
5 years ago
|
let(:create_page) { ::Pages::FullWorkPackageCreate.new(project: project) }
|
||
|
let(:view_page) { ::Pages::FullWorkPackage.new(project: project) }
|
||
7 years ago
|
|
||
|
before do
|
||
|
login_as(user)
|
||
|
end
|
||
|
|
||
4 years ago
|
it 'does not show read-only fields and allows setting the budget' do
|
||
5 years ago
|
create_page.visit!
|
||
7 years ago
|
|
||
4 years ago
|
expect(page).to have_selector('.inline-edit--container.budget')
|
||
5 years ago
|
expect(page).to have_no_selector('.inline-edit--container.laborCosts')
|
||
|
expect(page).to have_no_selector('.inline-edit--container.materialCosts')
|
||
|
expect(page).to have_no_selector('.inline-edit--container.overallCosts')
|
||
7 years ago
|
|
||
4 years ago
|
field = create_page.edit_field(:budget)
|
||
6 years ago
|
field.set_value budget.name
|
||
5 years ago
|
page.find('.ng-dropdown-panel .ng-option', text: budget.name).click
|
||
|
|
||
|
field = create_page.edit_field(:subject)
|
||
|
field.set_value 'Some subject'
|
||
|
|
||
|
create_page.save!
|
||
|
|
||
|
view_page.expect_notification(message: "Successful creation.")
|
||
|
|
||
4 years ago
|
view_page.edit_field(:budget).expect_display_value budget.name
|
||
7 years ago
|
end
|
||
|
end
|