Let’s make the last few changes to make our scenario pass. The next thing we need to do is to implement the last missing step. Add the following to features/step_definitions/view_steps.rb:
|||Then(/^I should see "([^"]*)"$/) do |text||
We’re using Capybara’s page object and have_content RSpec matcher here to verify that a snippet of text is on the page. We’ll explain more about that in the next chapter. This makes our step go from undefined to failing since the view doesn’t show what we want it to show. Remember—we just hard-coded a message in it.
We’ll work outside-in, starting with the app/views/users/show.html.erb view. Let’s ...