-
Notifications
You must be signed in to change notification settings - Fork 291
Testing Guide #99
Comments
This would be really nice. Right now the best we have is telling folks to look at the tests in the Phoenix suite. Maybe we can extract some of that into a general testing guide? Phoenix will eventually provide a Phoenix.Test helper module for easier testing, but we have some other things to tackle first. |
Since @josevalim did such a nice job with ConnTest we should be able to tackle this one. |
Thank you! Channel test should come this weekend. We also have ModelCase on José Valimwww.plataformatec.com.br |
👍 to the delights of ConnTest and ModelCase! Also, since the generators now provide test files, getting folks up to speed on testing models and controllers will be significantly easier, I think. Looking forward to having these conveniences on Channels as well. |
I just opened up PR #238 as a skeleton for this. I'm working on the intro now, and will head into the models and controllers in turn. The larger plan is to use the the HTML resource we built for ecto models as a jumping off place because a) folks should be familiar with the code already, and b) there are already tests in place that we can add on to. :^) |
Would you like some help here, @lancehalvorsen? I've had the chance to use |
Yes, please! Thanks so much for the offer, @gjaldon. :) |
@gjaldon, I just closed this #152, but there may still be things you can use from it. @paulcsmith has kindly offered it up if it's useful. |
@gjaldon LMK if you need any help with the channel guide. As @lancehalvorsen mentioned, the one I started might be a good outline for the new one |
@paulcsmith thanks! Will let you know if I get stuck and will likely use the one you started as outline. |
I'm going to start on a guide for Controller specs, specifically testing JSON responses. I personally never write controller tests if I'm rendering templates (I write feature tests), so if someone else would like to tackle that chunk that would be great. If not, I'll do it after I'm done with the JSON stuff. Or perhaps the guide for testing non API controllers is a guide on features tests? |
Also, I feel like we should have a task list so we have a goal to work toward for closing this:
Given that Models and Channels already have a guide, I feel like once we have these checked off that's the core of what people are generally testing, and other things like Routes, Mailers, can have their own issues. |
This covers testing an API controller, there is nothing in here for feature test style tests.
This covers testing an API controller, there is nothing in here for feature test style tests.
This covers testing an API controller, there is nothing in here for feature test style tests.
This covers testing an API controller, there is nothing in here for feature test style tests.
There have been several questions on the mailing list lately about how to test various parts of a Phoenix application. It would be great to have a guide as a reference.
The text was updated successfully, but these errors were encountered: