After adding Jasmine to the Gemfile and running the view_homepage_spec, I’m getting this error,
- View the homepage learn about the application
Failure/Error: expect(page).to have_css ‘title’, text: ‘Hashtag’
expected css “title” with text “Hashtag” to return something
# ./spec/integration/view_homepage_spec.rb:6:in `block (2 levels) in <top (required)>'
# ./spec/support/searcher.rb:4:in `block (2 levels) in <top (required)>'
However my app/views/layouts/application.html.erb contains the following,
This is the only change in view_homepage_spec.rb
scenario 'learn about the application', js: true do
The spec passes fine without adding the js. What am I missing?
Hello @MattBjornson. I don’t think jasmine is the cause of the test failure. Jasmine
tests are run via Capyabra and Rspec. The
js: true you reference will change
not related to Jasmine. You can read more about the various Capybara drivers in
the project Readme. You should only need to add the
js: true flag when you are
Each of the Capybara drivers is expected to perform very similarly, but there are
small differences and it looks like you’ve found one.
In addition, the version of Capybara will effect how title can be interacted
with. Specifically, as of Capybara 2.1, additional methods have been added to
Capybara so you can make assertions against the title like:
expect(page).to have_title 'Hashtag'
Hope that all helps.