diff --git a/features/create_budget.feature b/features/create_budget.feature index 9323cbff17..9281d5749a 100644 --- a/features/create_budget.feature +++ b/features/create_budget.feature @@ -13,10 +13,8 @@ Feature: Creating a Budget And I am already logged in as "testuser" When I go to the overview page of the project called "project1" - And I toggle the "Budgets" submenu - And I follow "New Budget" within "#main-menu" - And I fill in "cost_object_subject" with "budget1" - And I press "Create" + And I create a budget with the following: + | subject | budget1 | Then I should be on the show page for the budget "budget1" And I should see "Successful creation" diff --git a/features/step_definitions/cost_object_steps.rb b/features/step_definitions/cost_object_steps.rb new file mode 100644 index 0000000000..fa85df43a7 --- /dev/null +++ b/features/step_definitions/cost_object_steps.rb @@ -0,0 +1,10 @@ +When(/^I create a budget with the following:$/) do |table| + + rows = table.rows_hash + + steps %Q{And I toggle the "Budgets" submenu + And I follow "New Budget" within "#main-menu" + And I fill in "Subject" with "#{rows['subject']}"} + + click_button(I18n.t(:button_create), :exact => true) +end