Skip to content

Commit

Permalink
Merge pull request #105 from makandra/tt/fix_the-window-should-be-tit…
Browse files Browse the repository at this point in the history
…led_step

fix 'the window should be titled' step - closes: #102
  • Loading branch information
ThomasT-makandra authored Jul 15, 2019
2 parents 6a469d4 + 4b03f71 commit ad23bf6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/spreewald/web_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,11 @@

Then /^the window should be titled "([^"]*)"$/ do |title|
patiently do
expect(page).to have_css('title', :text => title)
if Spreewald::Comparison.compare_versions(Capybara::VERSION, :<, "2.1")
expect(page).to have_selector("title", :content => title)
else
expect(page).to have_title(title)
end
end
end.overridable

Expand Down
2 changes: 2 additions & 0 deletions tests/shared/app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
!!!
%html
%head
%title
= "spreewald test application"
%body
= yield
5 changes: 5 additions & 0 deletions tests/shared/features/shared/web_steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,8 @@ Feature: Web steps
And the "Disabled field #3" field should be disabled
But the "Enabled field #1" field should not be disabled
And the "Enabled field #2" field should not be disabled


Scenario: /^the window should be titled "([^"]*)"$/
When I go to "/static_pages/home"
Then the window should be titled "spreewald test application"

0 comments on commit ad23bf6

Please sign in to comment.