|
|
|
@ -40,13 +40,19 @@ module Pages |
|
|
|
|
@parent_work_package = parent_work_package |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def expect_heading |
|
|
|
|
if parent_work_package |
|
|
|
|
expect(page).to have_selector('h2', text: I18n.t('js.work_packages.create.header_with_parent', |
|
|
|
|
type: parent_work_package.type, |
|
|
|
|
id: parent_work_package.id)) |
|
|
|
|
def expect_heading(type=nil) |
|
|
|
|
if type.nil? |
|
|
|
|
expect(page).to have_selector('h2', text: I18n.t('js.work_packages.create.header_no_type')) |
|
|
|
|
|
|
|
|
|
elsif parent_work_package |
|
|
|
|
expect(page).to have_selector('h2', |
|
|
|
|
text: I18n.t('js.work_packages.create.header_with_parent', |
|
|
|
|
type: type, |
|
|
|
|
parent_type: parent_work_package.type, |
|
|
|
|
id: parent_work_package.id)) |
|
|
|
|
else |
|
|
|
|
expect(page).to have_selector('h2', text: I18n.t('js.work_packages.create.header')) |
|
|
|
|
expect(page).to have_selector('h2', text: I18n.t('js.work_packages.create.header', |
|
|
|
|
type: type)) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|