Ember.js - Testing on Rails
This book is 90% complete
Last updated on 2014-05-05
About the Book
Now that Ember.js is stabilizing many developers are looking for information on how to create a comprehensive test suite for their apps. Integrating Ember with Ruby on Rails is great for developer happiness, but building an automated test suite which integrated the Ember fronted seems to be an area that needs more information.
In this book I will cover
- Building an app with Rails 4 and Ember.js
- Creating an automated test suite which covers both front and backend
- The hooks available in Ember to allow testing
- Testing relationships in Ember
- Developing your own testing helpers
I hope you enjoy the book and look forward to your feedback.
If you're not a Rails developer, you'll still find benefit from the testing strategies, but the book has a significant Rails focus.
Just to be really clear, Ember is still in constant development, but I will aim to keep up to date with what's going on and will adjust the book to deal with any changes that affect the content. If you discover a problem, let me know and I'll get on to it as soon as possible!
WARNING - Given the speed with which Ember has developed much of the information is now outdated. I'm leaving it out here for FREE now because the information about working in a test driven style is still relevant, but much of the implementation is no longer functional.
- A Bit About My Motivation
- First There Was Rails
- Along Came jQuery
- Testing to the Rescue
- Design Choices, the Golden Path and ‘Why Didn’t You Include / Use / Show X, Y, Z?”
Chapter One - Bootstrapping Our App
- What are we going to build?
- Generating Our App
- Getting Rid of Some Junk
- Some Additional Development Dependencies
- Install Ember
Chapter Two - Testing Setup
Chapter Three - Routing Specs
- QUnit Specs (or Are They Tests?)
- Creating a Contacts Route
- And So a Problem Presents Itself
- An Abstraction Trying to Get Out?
Chapter Four - Getting Started With Data Rendering
- Unit Testing Our Model
- An Unexpected Problem
Chapter Five - Nested Routes
- Defining Routes Within Resources
- Rendering the Individual Contact
- Refactor Tests
- An Alternate Way of Viewing Our Specs
- Navigating Around the App
Chapter Six - Persisting Data With Rails
- Setting Up the Backend
- Serializing the Data
- Connecting the Backend to the Frontend!
- More Routes Necessary
- Adding Contacts
- Deleting a Contact
Chapter 7 - Relationships in Ember
- A Place to Store Emails
- Testing Relationships
- Rendering Relationships
- Wiring Up the Relationships to Rails
- An Email Model
- Contact Relationship
- Email Relationship
- Email Controller and Routes
- Serializing and Relationships
- Chapter 8 - Unit Testing Computed Properties
Chapter 9 - Creating and Updating Emails on the Frontend
- Faking HTTP Requests
- Reimplementing RESTAdapter in Tests
- Saving Associations
- Dealing With Failed Saves
- Testing JSON Responses in Rails
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...