Kleber Shimabuku
2012-May-23 22:27 UTC
[rspec-users] received unexpected message :id= with (20)
Please help me to understand this error message: 1) PostsController#create when logged in should create a new post and redirect to a successful message page Failure/Error: post ''create'', { post: {title: ''New post'', Mock Post(id: integer, title: string, description: text, location: string, created_at: datetime, updated_at: datetime, status: string, tags: string, views: integer, user_id: integer) received unexpected message :id= with (20) # ./spec/controllers/posts_controller_spec.rb:56:in `block (4 levels) in <top (required)>'' Finished in 0.59991 seconds 6 examples, 1 failure I''m trying to figure out this for about a week or more :( Attachments: http://www.ruby-forum.com/attachment/7429/posts_controller_spec.rb http://www.ruby-forum.com/attachment/7430/posts_controller.rb -- Posted via http://www.ruby-forum.com/.
On May 23, 2012, at 4:27 PM, Kleber Shimabuku wrote:> Please help me to understand this error message: > > 1) PostsController#create when logged in should create a new post and > redirect to a successful message page > Failure/Error: post ''create'', { post: {title: ''New post'', > Mock Post(id: integer, title: string, description: text, > location: string, created_at: datetime, updated_at: datetime, status: > string, tags: string, views: integer, user_id: integer) received > unexpected message :id= with (20)I''m guessing the `Post` mock is making its way to the model layer. Either way, you need to find out why `id=` is getting called. Shot in the dark: There is a lot of "post" names there. Maybe there is a conflict?> # ./spec/controllers/posts_controller_spec.rb:56:in `block (4 > levels) in <top (required)>'' > > Finished in 0.59991 seconds > 6 examples, 1 failure > > > > I''m trying to figure out this for about a week or more :( > > Attachments: > http://www.ruby-forum.com/attachment/7429/posts_controller_spec.rb > http://www.ruby-forum.com/attachment/7430/posts_controller.rb > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Apparently Analagous Threads
- undefined method `route_for' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:
- nested route not receiving :id parameter within controller spec
- showing posts in blog
- autotest and rspec_on_rails not happy
- Could anyone please help with rspec/nested resource behavior checking?