Making the Capybara Test Pass
Letâs go through the integration-test process.
Our first error is right on the first line: projects(:bluebook) is a call to a fixture method, but we havenât defined any fixture named bluebook. Thatâs easy enough to fix. We need to add some fixture files to the spec directory:
integration/01/gatherer/spec/fixtures/projects.yml | |
â | one: |
â | name: âMyStringâ |
â | due_date: â2013-11-10â |
â | |
â | two: |
â | name: âMyStringâ |
â | due_date: â2013-11-10â |
â | |
â | bluebook: |
â | name: âProject Blue Bookâ |
â | due_date: â<%= 6.months.from_now %>â |
While weâre at it, weâll need two project tasks to make the sorting work. We also must add belongs_to :project in app/models/task.rb:
integration/01/gatherer/spec/fixtures/tasks.yml ... |
Get Rails 4 Test Prescriptions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.