Associating a Message with a User

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

rails/08/app/models/message.rb
 
class​ Message < ActiveRecord::Base
 
belongs_to :user
 
attr_accessible :content, :user_id
 
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 ...

Get The Cucumber Book 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.