Sha256: 9929e1f8242d0fa1847160ee6e3fd61fdb52f2c5f68de37cab19e3f133d774d4

Contents?: true

Size: 1.94 KB

Versions: 27

Compression:

Stored size: 1.94 KB

Contents

Given(/^an existing corporation$/) do
  @corporation = create(:customer_vault_corporation)
  @person = @corporation
end

Given(/^an existing individual$/) do
  @individual = create(:customer_vault_individual)
  @person = @individual
end

Given(/^an existing link$/) do
  @link = create(:customer_vault_link)
  @individual = @link.alice
  @corporation = @link.bob
end

When(/^I navigate to the link section of the indidual details$/) do
  visit dorsale.customer_vault_individual_path(@individual)
  find("a[href$=links]").click
end

When(/^I add a new link to the corporation$/) do
  find("#context-main [href$='links/new']").click
  expect(current_path).to eq dorsale.new_customer_vault_corporation_link_path(@corporation)
end

When(/^I add a new link to the individual$/) do
  find("#context-main [href$='links/new']").click
  expect(current_path).to eq dorsale.new_customer_vault_individual_link_path(@individual)
end

When(/^I provide the link and the target corporation$/) do
  select @corporation.name
  fill_in "link_title", with: "Manager"
end

When(/^I validate the link$/) do
  find("[type=submit]").click
end

When(/^I edit the link$/) do
  find(".person .pull-right .link_update").click
end

When(/^I change the title$/) do
  fill_in "link_title", with: "Manager 2"
end

When(/^I navigate to the link section of the corporation details$/) do
  visit dorsale.customer_vault_corporation_path(@corporation)
  find("a[href$=links]").click
end

When(/^I provide the link and the target individual$/) do
  select @individual.name
  fill_in "link_title", with: "Manager"
end

When(/^I delete the link$/) do
  find(".person .pull-right .link_delete").click
end

Then(/^the new link is displayed$/) do
  expect(page).to have_selector ".title", text: "Manager"
end

Then(/^the edited link is displayed$/) do
  expect(page).to have_selector ".title", text: "Manager 2"
end

Then(/^the targeted link is removed$/) do
  expect(page).to_not have_selector ".title", text: "Manager"
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
dorsale-4.0.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.20.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.19.1 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.19.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.18.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.17.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.16.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.15.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.11 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.10 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.9 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.8 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.7 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.6 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.5 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.3 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.2 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.1 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.14.0 features/step_definitions/customer_vault_links_steps.rb
dorsale-3.13.0 features/step_definitions/customer_vault_links_steps.rb