-
-
Save ebryn/5499010 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
providers.then -> | |
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