#= require spec_helper

describe "<%= model_name %>", ->
  beforeEach( ->
    Test.store = TestUtil.lookupStore()
  )

  it "is a DS.Model", ->
    assert.ok <%= model_name %>
    assert.ok DS.Model.detect(<%= model_name %>)

  describe "attribute: name", ->
    it "can be created with valid value", ->
      Ember.run( ->
        Test.contact = <%= model_name %>.createRecord name: 'Joe'
      )
      expect(Test.contact.get 'name').to.equal 'Joe'

    it "can NOT be created with invalid value", ->
      Ember.run( ->
        Test.contact = <%= model_name %>.createRecord name: '123'
      )
      expect(Test.contact.get 'name').to.not.equal 'Joe'
      expect(Test.contact.isValid).to.be false

#= require spec_helper

describe "<%= model_name %>", ->
  beforeEach( ->
    Test.store = TestUtil.lookupStore()
  )

  it "is a DS.Model", ->
    assert.ok <%= model_name %>
    assert.ok DS.Model.detect(<%= model_name %>)

  describe "attribute: name", ->
    it "can be created with valid value", ->
      Ember.run( ->
        Test.contact = Test.store.createRecord '<%= class_name.downcase %>', name: 'Joe'
      )
      expect(Test.contact.get 'name').to.equal 'Joe'

    it "can NOT be created with invalid value", ->
      Ember.run( ->
        Test.contact = Test.store.createRecord '<%= class_name.downcase %>', name: '123'
      )
      expect(Test.contact.get 'name').to.not.equal 'Joe'
      expect(Test.contact.isValid).to.be false

Change model generator for latest Ember data syntax
Change model generator for latest Ember data syntax