Posting a Message
To implement our second step, we’re going to cheat again and simulate the posting of a message by calling the models directly. This allows us to focus on building the messages page without getting too distracted. Let’s implement the second step definition:
|||Given(/^the User has posted the message "([^"]*)"$/) do |message_text||
|||expect(User.count).to eq 1|
|||FactoryGirl.create(:message, :content => message_text, :user => User.first)|
A Given means that something has happened in the ...