Having difficulties in ending Michael Hartl's tutorial. Help?

Posted by konzepz on Stack Overflow See other posts from Stack Overflow or by konzepz
Published on 2011-01-12T22:49:47Z Indexed on 2011/01/12 23:53 UTC
Read the original article Hit count: 300

Filed under:
|
|

Following Michael Hartl's (amazing) Ruby on Rails Tutorial, on the final section, I get the following errors:

1) User micropost associations status feed should include the microposts of followed users
 Failure/Error: @user.feed.should include(mp3)
 expected [#<Micropost id: 2, content: "Foo bar", user_id: 1, created_at: "2011-01-12 21:22:41", updated_at: "2011-01-12 22:22:41">, #<Micropost id: 1, content: "Foo bar", user_id: 1, created_at: "2011-01-11 22:22:41", updated_at: "2011-01-12 22:22:41">] to include #<Micropost id: 3, content: "Foo bar", user_id: 2, created_at: "2011-01-12 22:22:41", updated_at: "2011-01-12 22:22:41">
 Diff:
 @@ -1,2 +1,2 @@
 -#<Micropost id: 3, content: "Foo bar", user_id: 2, created_at: "2011-01-12 22:22:41", updated_at: "2011-01-12 22:22:41">
 +[#<Micropost id: 2, content: "Foo bar", user_id: 1, created_at: "2011-01-12 21:22:41", updated_at: "2011-01-12 22:22:41">, #<Micropost id: 1, content: "Foo bar", user_id: 1, created_at: "2011-01-11 22:22:41", updated_at: "2011-01-12 22:22:41">]
 # ./spec/models/user_spec.rb:214

2) Micropost from_users_followed_by should include the followed user's microposts
 Failure/Error: Micropost.from_users_followed_by(@user).should include(@other_post)
 expected [#<Micropost id: 1, content: "foo", user_id: 1, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">] to include #<Micropost id: 2, content: "bar", user_id: 2, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">
 Diff:
 @@ -1,2 +1,2 @@
 -#<Micropost id: 2, content: "bar", user_id: 2, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">
 +[#<Micropost id: 1, content: "foo", user_id: 1, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">]
 # ./spec/models/micropost_spec.rb:75

Finished in 9.18 seconds
153 examples, 2 failures

Seems like mp3 is not included in the feed. Any ideas on how to fix it? Or where to look for possible errors in the code? I compared the files with Hartl's original code; seems exact.

Thanks.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about error