Part 3: Happy paths for sorting movies by title and by release date
-
Since the scenarios in
sort_movie_list.featureinvolve sorting, you will need the ability to have steps that test whether one movie appears before another in the output listing. Create a step definition that matches a step such asThen I should see "Aladdin" before "Amelie"📌 HINTS
pageis the Capybara method that returns an object representing the page returned by the app server. You can use it in expectations such asexpect(page).to have_content('Hello World'). More importantly, you can search the page for specific elements matching CSS selectors or XPath expressions; see the Capybara documentation under Querying.page.bodyis the page’s HTML body as one giant string.- A regular expression could capture whether one string appears before another in a larger string, though that’s not the only possible strategy.
- Use the step definition you create above to complete the scenarios
sort movies alphabeticallyandsort movies in increasing order of release dateinsort_movie_list.feature.
SUCCESS is all steps of all scenarios in both feature files passing Green.
Committing to GitHub
There’s no need to deploy this CHIPS to Heroku, but please do make a commit and push it to your private GitHub repository with your final code.