|
|
|
@ -84,14 +84,14 @@ describe 'Work package relations tab', js: true, selenium: true do |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'as admin' do |
|
|
|
|
let!(:parent) { FactoryGirl.create(:work_package, project: project) } |
|
|
|
|
let!(:child) { FactoryGirl.create(:work_package, project: project) } |
|
|
|
|
let!(:child2) { FactoryGirl.create(:work_package, project: project, subject: 'Something new') } |
|
|
|
|
let!(:parent) { FactoryGirl.create(:work_package, project: project) } |
|
|
|
|
let!(:child) { FactoryGirl.create(:work_package, project: project) } |
|
|
|
|
let!(:child2) { FactoryGirl.create(:work_package, project: project, subject: 'Something new') } |
|
|
|
|
|
|
|
|
|
it 'allows to mange hierarchy' do |
|
|
|
|
# Shows link parent link |
|
|
|
|
expect(page).to have_selector('#hierarchy--add-parent') |
|
|
|
|
find('.wp-inline-create--add-link', |
|
|
|
|
find('.work-packages--details .wp-inline-create--add-link', |
|
|
|
|
text: I18n.t('js.relation_buttons.add_parent')).click |
|
|
|
|
|
|
|
|
|
# Add parent |
|
|
|
@ -99,14 +99,14 @@ describe 'Work package relations tab', js: true, selenium: true do |
|
|
|
|
|
|
|
|
|
## |
|
|
|
|
# Add child #1 |
|
|
|
|
find('.wp-inline-create--add-link', |
|
|
|
|
find('.work-packages--details .wp-inline-create--add-link', |
|
|
|
|
text: I18n.t('js.relation_buttons.add_existing_child')).click |
|
|
|
|
|
|
|
|
|
add_hierarchy('.wp-relations--child-form', child.id, child.subject) |
|
|
|
|
|
|
|
|
|
## |
|
|
|
|
# Add child #2 |
|
|
|
|
find('.wp-inline-create--add-link', |
|
|
|
|
find('.work-packages--details .wp-inline-create--add-link', |
|
|
|
|
text: I18n.t('js.relation_buttons.add_existing_child')).click |
|
|
|
|
|
|
|
|
|
add_hierarchy('.wp-relations--child-form', child2.subject, child2.subject) |
|
|
|
@ -208,7 +208,7 @@ describe 'Work package relations tab', js: true, selenium: true do |
|
|
|
|
it 'should be able to link parent and children' do |
|
|
|
|
# Shows link parent link |
|
|
|
|
expect(page).to have_selector('#hierarchy--add-parent') |
|
|
|
|
find('.wp-inline-create--add-link', |
|
|
|
|
find('.work-packages--details .wp-inline-create--add-link', |
|
|
|
|
text: I18n.t('js.relation_buttons.add_parent')).click |
|
|
|
|
|
|
|
|
|
# Add parent |
|
|
|
@ -216,7 +216,7 @@ describe 'Work package relations tab', js: true, selenium: true do |
|
|
|
|
|
|
|
|
|
## |
|
|
|
|
# Add child |
|
|
|
|
find('.wp-inline-create--add-link', |
|
|
|
|
find('.work-packages--details .wp-inline-create--add-link', |
|
|
|
|
text: I18n.t('js.relation_buttons.add_existing_child')).click |
|
|
|
|
|
|
|
|
|
add_hierarchy('.wp-relations--child-form', child.id, child.subject) |
|
|
|
|