Associating a Message with a User

We haven’t defined our user association on the Message model yet. Let’s do that now:

 class​ Message < ActiveRecord::Base
  belongs_to ​:user
 end

Cucumber now outputs this:

 Feature: See Messages
 
  Scenario: See another user's messages
  Given there is a User
  And the User has posted the message "this is my message"
  When I visit the page for the User
  Undefined step: "I visit the page for the User" (Cucumber::Undefined)
  features/see_messages.feature:5
  Then I should see "this is my message"
  Undefined step: "I should see "this is my message"" (Cucumber::Undefined)
  features/see_messages.feature:6
 
 1 scenario (1 undefined)
 4 steps (2 undefined, 2 passed)
 

Get The Cucumber Book, 2nd Edition 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.