Sha256: 8d2cbcddb28d70b3cc535fb708587e5cdfa35dfffef17a607b0d5fd1bea8f689

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

When(/^I go on the tasks section$/) do
  find("a[href='#tasks']").click
end

When(/^I create a task on this person$/) do
  @tasks_count = ::Dorsale::Flyboy::Task.count
  find("#tasks a[href*='tasks/new']").click
  fill_in :task_name, with: "YepYep"
  fill_in :task_description, with: "Trololo"
  find("[type=submit]").click
end

Then(/^the person task is created$/) do
  expect(::Dorsale::Flyboy::Task.count).to eq(@tasks_count + 1)
  @task = ::Dorsale::Flyboy::Task.order(:id).last

  if @corporation
    url = dorsale.customer_vault_corporation_path(@corporation)
  elsif @individual
    url = dorsale.customer_vault_individual_path(@individual)
  else
    raise "invalid person"
  end

  expect(current_path).to eq url
end

Then(/^the task appear$/) do
  expect(page).to have_content "YepYep"
end

When(/^I go on the general tasks page$/) do
  visit dorsale.flyboy_tasks_path
end

When(/^I filter tasks$/) do
  find(".filter-submit").click
end

Then(/^I an redirected on the tasks tab$/) do
  expect(current_path).to eq dorsale.customer_vault_individual_path(@individual)
  hash = page.evaluate_script("location.href").split("#").last
  expect(hash).to eq "tasks"
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dorsale-3.1.7 features/step_definitions/customer_vault_tasks_steps.rb
dorsale-3.1.6 features/step_definitions/customer_vault_tasks_steps.rb
dorsale-3.1.5 features/step_definitions/customer_vault_tasks_steps.rb
dorsale-3.1.4 features/step_definitions/customer_vault_tasks_steps.rb
dorsale-3.1.3 features/step_definitions/customer_vault_tasks_steps.rb
dorsale-3.1.2 features/step_definitions/customer_vault_tasks_steps.rb