loading...

re: My First Ruby on Rails Presenter VIEW POST

FULL DISCUSSION
 

Over my time using Rails I drifted in and out of using presenters. I don't know why though, they do make things a whole bunch easier and let the controller just get on with its job.

Did you consider writing tests for your presenter in this case?

 

I did briefly, although I haven't been focusing on testing enough as I should be lately. Is it normal practice to write presenter tests? I just assumed each presenter should have its own tests to ensure all the data is calculated and modified correctly.

 

I would normally write tests for a presenter if I was writing one, exactly as you put it, to ensure that the calculations are correct.

One other thing I was interested in, you used delegate to delegate methods on your presenter to the underlying @category but also defined the id, created_at and budget methods. Was there a reason for that?

code of conduct - report abuse