[rspec-users] [newbie]: How to test for operations inside a block?

Carmine Moleti lists at ruby-forum.com
Mon Sep 22 14:26:09 EDT 2008

[...huge cut...]
> In general, the mantra is "skinny controllers, fat models," meaning that 

Indeed, while waitin for a reply, I googled a bit and came right to the
"skinny controllers, fat models" post!

So I've refactored the user creation code into a class method on User.

User.create_with_role(:role, identity_url, registration)

Thus cleaning a bit the whole code.

> It looks like you want to use something like
> @controller.should_receive(:authenticate_with_open_id).and_yield(<etc>)
> I didn't know about and_yield() before. Cool!

I will surely have a look at the "and_yield()", thanks!

Again, thanks for your precious help and time!
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list