[rspec-users] How to properly mock a complex object "comment.initiator.group.name"?
evgeny.bogdanov at gmail.com
Wed Feb 25 05:13:17 EST 2009
I am wondering what is the best way to mock such expression:
What I do now is:
comment = mock_model(Comment)
initiator = mock_model(User)
group = mock_model(Group, :name => "Admin")
So it becomes quite complex when the length of the expression
Is it possible to do something like this:
Thank you in advance!
More information about the rspec-users