|
|
|
@ -137,17 +137,31 @@ describe 'Work package relations tab', js: true, selenium: true do |
|
|
|
|
find(toggle_btn_selector).click |
|
|
|
|
expect(page).to have_selector(toggle_btn_selector, text: 'Group by relation type', wait: 10) |
|
|
|
|
|
|
|
|
|
# Expect current to be follows and other one related |
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Follows') |
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Related To') |
|
|
|
|
|
|
|
|
|
# Expect current to be follows, then edit to blocks |
|
|
|
|
# edit to blocks |
|
|
|
|
relations.edit_relation_type(to_1, to_type: 'Blocks') |
|
|
|
|
|
|
|
|
|
# the other one should not be altered |
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Blocks') |
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Related To') |
|
|
|
|
|
|
|
|
|
updated_relation = Relation.find(relation_1.id) |
|
|
|
|
expect(updated_relation.relation_type).to eq('blocks') |
|
|
|
|
expect(updated_relation.from_id).to eq(work_package.id) |
|
|
|
|
expect(updated_relation.to_id).to eq(to_1.id) |
|
|
|
|
|
|
|
|
|
relations.edit_relation_type(to_1, to_type: 'Blocked by') |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Blocked by') |
|
|
|
|
expect(page).to have_selector('.relation-row--type', text: 'Related To') |
|
|
|
|
|
|
|
|
|
updated_relation = Relation.find(relation_1.id) |
|
|
|
|
expect(updated_relation.relation_type).to eq('blocks') |
|
|
|
|
expect(updated_relation.from_id).to eq(to_1.id) |
|
|
|
|
expect(updated_relation.to_id).to eq(work_package.id) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|