views:

40

answers:

1

How I can test a send_data method?

A: 

You shouldn't need to test the behaviour of send_data itself, mainly because that's covered by Rails' own tests and It will make run your tests slowly (eventually). What you should do (from my perspective) is to stub the send_data method, something like:

controller.expects(:send_data).with("foo").returns(:success)

Hope It helps.

jpemberthy