Ember.js - Testing on Rails
Ember.js - Testing on Rails
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 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.