Skip to content

Instantly share code, notes, and snippets.

@walter
Created May 1, 2013 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save walter/5499006 to your computer and use it in GitHub Desktop.
Save walter/5499006 to your computer and use it in GitHub Desktop.
App = require 'app'
require 'models/provider'
require 'stores/provider'
# Sample test case
describe 'Provider', ->
describe '#create()', ->
# essentially this is testing that our configuration is working
# so somewhat of a redundant test
it 'should return a new Provider record matching input', ->
titleValue = "Example.com"
domainValue = 'example.com'
Ember.run ->
provider = App.Provider.create
title: titleValue
domain: domainValue
provider.save()
providers = App.Provider.find()
console.log Ember.inspect providers.get('firstObject')
console.log providers.get('isLoaded')
# there should now be 1 provider
expect( providers.get('length') ).to.equal 1
provider = providers.firstObject()
# properties of provider should match parameter values
expect( provider.get('title') ).to.equal titleValue
expect( provider.get('domain') ).to.equal domainValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment