Comments (12)
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.
from phoenix_guides.
Since @josevalim did such a nice job with ConnTest we should be able to tackle this one.
from phoenix_guides.
Thank you! Channel test should come this weekend. We also have ModelCase on
v0.12.0z
José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Lead Developer
from phoenix_guides.
👍 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.
from phoenix_guides.
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. :^)
from phoenix_guides.
Would you like some help here, @lancehalvorsen? I've had the chance to use Phoenix.ChannelTest
when working with the channel generator in Phoenix and have used ConnTest and ModelCase in an app I'm building.
from phoenix_guides.
Yes, please! Thanks so much for the offer, @gjaldon. :)
from phoenix_guides.
@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.
from phoenix_guides.
@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
from phoenix_guides.
@paulcsmith thanks! Will let you know if I get stuck and will likely use the one you started as outline.
from phoenix_guides.
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?
from phoenix_guides.
Also, I feel like we should have a task list so we have a goal to work toward for closing this:
- Controller Tests
- Feature Tests ??
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.
from phoenix_guides.
Related Issues (20)
- 404: Up and Running - assets/images/welcome-to-phoenix.png HOT 2
- Links to 3rd party deployment guides HOT 2
- Ecto - Data Persistence - Missing 'alias' in Example HOT 1
- Context - In Context Relationships - Missing 'alias' in Example HOT 1
- Context - FIX MEs HOT 3
- Broken Image links in Up and Running Tutorial
- Broken image in "Up and Running" HOT 1
- Replace references to mix phoenix.new with mix phx.new in Mix Tasks Guide HOT 1
- 1.3 upgrade from 1.2: web console shows Uncaught Error: Cannot find module 'js/app' from '/' HOT 1
- Dynamically Link to latest Supported Elixir
- Move Bonus Guides to phoenix_site
- Add Phoenix.js Documentation Link
- Document Contributing to the Guides
- Merge phoenix_guides into phoenix
- Migrate Bonus Guides to Blog
- Books Section HOT 2
- Controller 1.3 Updates HOT 1
- warn about using handle_out with potential N query problems
- Don't recommend generating a skeleton app in the intro HOT 1
- testing_controllers.md seems out of date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phoenix_guides.