#= require 'spec_helper'!
!
describe 'Cats page', ->!
beforeEach ->!
cat = Ember.Object.create!
id: 1!
name: 'Mimi'!
!
stubStore = sinon.stub(testHelper.lookup('store'), 'find')!
stubStore.withArgs('cat').returns([cat])!
!
!
visit '/'!
!
it 'shows the names of the cats', ->!
expect($('li').text()).to.equal('Mimi')!
!
it 'links to a cat page', ->!
mock = sinon.mock(testHelper.lookup('route', 'cats_cat'))!
mock.expects('setupController').once()!
$('a').click()!
mock.verify()