bug: featuresteps: custom field set,wp field check

pull/834/head
Nils Kenneweg 11 years ago
parent b5eb70728a
commit 8f188d2e0e
  1. 2
      features/step_definitions/common_steps.rb
  2. 14
      features/step_definitions/custom_field_steps.rb
  3. 17
      features/work_packages/editable_fields.feature

@ -63,7 +63,7 @@ Given /^the [pP]roject(?: "([^\"]+?)")? uses the following types:$/ do |project,
end
Then(/^I should see the following fields:$/) do |table|
table.rows.each do |field, value|
table.raw.each do |field, value|
# enforce matches including the value only if it is provided
# i.e. the column in the table is created

@ -64,7 +64,19 @@ Given /^the work package "(.+?)" has the custom field "(.+?)" set to "(.+?)"$/ d
wp = InstanceFinder.find(WorkPackage, wp_name)
custom_field = InstanceFinder.find(WorkPackageCustomField, field_name)
wp.custom_values.build(:custom_field => custom_field, :value => value)
set = false
wp.custom_values.each do |custom_value|
if custom_value.custom_field_id == custom_field.id then
set = true
custom_value.value = value
end
end
if !set then
wp.custom_values.build(:custom_field => custom_field, :value => value)
end
wp.save!
end

@ -68,7 +68,7 @@ Feature: Fields editable on work package edit
And I follow "More"
Then I should see the following fields:
| Type | Phase1 |
| Type | Phase |
| Subject | pe1 |
| Description | pe1 description |
| Priority | prio1 |
@ -109,17 +109,24 @@ Feature: Fields editable on work package edit
Given the role "manager" may have the following rights:
| edit_work_packages |
Given the following work package custom fields are defined:
And there are the following types:
| Name |
| Phase |
And the project "ecookbook" has the following types:
| name | position |
| Phase | 1 |
And the following work package custom fields are defined:
| name | type |
| cf1 | int |
And the custom field "cf1" is activated for type "Phase"
And there are the following work packages in project "ecookbook":
| subject |
| pe1 |
| subject | type |
| pe1 | Phase |
And the work package "pe1" has the custom field "cf1" set to "4"
When I go to the edit page of the work package called "pe1"
Then I should see the following fields:
| cf1 | 4 |
| cf1 | 4 |
Loading…
Cancel
Save