OpenProject is the leading open source project management software.
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.
 
 
 
 
 
 
openproject/spec/features/costs_edit_fields_spec.rb

54 lines
2.0 KiB

#-- copyright
# OpenProject Costs Plugin
#
# Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 3.
#
# 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.
#++
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
describe 'Work Package cost fields', type: :feature, js: true do
let(:type_task) { FactoryGirl.create(:type_task) }
let!(:status) { FactoryGirl.create(:status, is_default: true) }
let!(:priority) { FactoryGirl.create(:priority, is_default: true) }
let!(:project) {
FactoryGirl.create(:project, types: [type_task])
}
let(:user) { FactoryGirl.create :admin }
let(:budget) { FactoryGirl.create :cost_object, author: user, project: project }
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
let(:split_create) { ::Pages::SplitWorkPackageCreate.new(project: project) }
before do
budget
login_as(user)
end
it 'does not show read-only fields' do
wp_table.visit!
wp_table.expect_no_work_package_listed
split_create.click_create_wp_button type_task.name
split_create.expect_fully_loaded
expect(page).to have_selector('.wp-edit-field--container.costObject')
expect(page).to have_no_selector('.wp-edit-field--container.laborCosts')
expect(page).to have_no_selector('.wp-edit-field--container.materialCosts')
expect(page).to have_no_selector('.wp-edit-field--container.overallCosts')
select budget.name, from: 'wp-new-inline-edit--field-costObject'
end
end