Properly target breadcrumbs entries.

The current features/menu_spec.rb selects Cost reports from the entire
.breadcrumb using a `text:` selector.

As the tests are working locally, I can only assume this is connected to
how capybara evaluates the text selector.
If it selects text using innerText, this may fail for some browsers.

The spec is now addressed on the breadcrumb li item diirectly.
pull/6827/head
Oliver Günther 9 years ago
parent 9b497090a5
commit e774c5fe1a
  1. 5
      spec/features/menu_spec.rb

@ -67,7 +67,8 @@ describe 'project menu', type: :feature do
it 'leads to cost reports' do
click_on 'Cost reports'
expect(page).to have_selector('.breadcrumb', text: 'HomePonyoCost reports')
expect(page).to have_selector('.breadcrumb > li', text: 'Ponyo')
expect(page).to have_selector('.breadcrumb > li', text: 'Cost reports')
end
end
@ -96,7 +97,7 @@ describe 'project menu', type: :feature do
click_on 'Cost reports'
end
expect(page).to have_selector('.breadcrumb', text: 'Cost reports')
expect(page).to have_selector('.breadcrumb > li', text: 'Cost reports')
# to make sure we're not seeing the project cost reports:
expect(page).not_to have_text('Ponyo')

Loading…
Cancel
Save