Unit Testing Basics

Unit tests are generally used to test a small piece of code and ensure that it
is doing what was intended. Unlike acceptance tests, they are narrow in scope
and do not require the Ember application to be running.

As it is the basic object type in Ember, being able to test a simple
Ember.Object sets the foundation for testing more specific parts of your
Ember application such as controllers, components, etc. Testing an Ember.Object
is as simple as creating an instance of the object, setting its state, and
running assertions against the object. By way of example lets look at a few
common cases.

Testing Computed Properties

Let's start by looking at an object that has a computedFoo computed property
based on a foo property.

In the event the object's method returns a value you can simply assert that the
return value is calculated correctly. Suppose our object has a calc method
that returns a value based on some internal state.