Sha256: 6ed63f1f4ce7aab21423c97134701270238d25737a3481ccca7e5591401049f0

Contents?: true

Size: 1.46 KB

Versions: 24

Compression:

Stored size: 1.46 KB

Contents

Given(/^the user goes on the new expense category page$/) do
  visit dorsale.expense_gun_categories_path
  find(".link_create").click
end

When(/^he fills the category's information$/) do
  fill_in 'category_name', with: "Category Name"
  fill_in 'category_code', with: "Category Code"
  select "Oui"
end

When(/^creates a new expense category$/) do
  find("[type=submit]").click
end

Then(/^the category is added to the category list$/) do
  expect(page).to have_content "Category Name"
  expect(page).to have_content "Category Code"
  expect(page).to have_css(".fa-check")
end

Given(/^an existing expense category$/) do
  @category = create(:expense_gun_category, vat_deductible: true)
end

When(/^I edit the expense category$/) do
  visit dorsale.expense_gun_categories_path
  find(".link_update").click
end

Then(/^the current expense category's label should be pre\-filled$/) do
  expect(page).to have_field("category_name", with: @category.name)
end

When(/^he validates the new expense category$/) do
  fill_in "category_name", with: "New Category Name"
  fill_in "category_code", with: "New Category Code"
  select "Non"
  find("[type=submit]").click
end

Then(/^he is redirected on the expense categories page$/) do
  expect(current_path).to eq dorsale.expense_gun_categories_path
end

Then(/^the expense category's label is updated$/) do
  expect(page).to have_content "New Category Name"
  expect(page).to have_content "New Category Code"
  expect(page).to have_css(".fa-remove")
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
dorsale-3.8.1 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.8.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.8 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.7 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.6 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.5 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.4 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.2 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.1 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.7.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.6.1 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.6.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.5.2 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.5.1 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.5.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.4.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.3.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.2.0 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.1.7 features/step_definitions/expense_gun_categories_steps.rb
dorsale-3.1.6 features/step_definitions/expense_gun_categories_steps.rb