DEV Community


Discussion on: My First Ruby on Rails Presenter

maxwell_dev profile image
Max Antonucci Author

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.

philnash profile image
Phil Nash

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?