3 var proxyquire = require('proxyquire').noPreserveCache();
6 index: 'showCtrl.index',
8 create: 'showCtrl.create',
9 update: 'showCtrl.update',
10 destroy: 'showCtrl.destroy'
21 // require the index with our stubbed out modules
22 var showIndex = proxyquire('./index.js', {
28 './show.controller': showCtrlStub
31 describe('Show API Router:', function() {
33 it('should return an express router instance', function() {
34 showIndex.should.equal(routerStub);
37 describe('GET /api/shows', function() {
39 it('should route to show.controller.index', function() {
41 .withArgs('/', 'showCtrl.index')
42 .should.have.been.calledOnce;
47 describe('GET /api/shows/:id', function() {
49 it('should route to show.controller.show', function() {
51 .withArgs('/:id', 'showCtrl.show')
52 .should.have.been.calledOnce;
57 describe('POST /api/shows', function() {
59 it('should route to show.controller.create', function() {
61 .withArgs('/', 'showCtrl.create')
62 .should.have.been.calledOnce;
67 describe('PUT /api/shows/:id', function() {
69 it('should route to show.controller.update', function() {
71 .withArgs('/:id', 'showCtrl.update')
72 .should.have.been.calledOnce;
77 describe('PATCH /api/shows/:id', function() {
79 it('should route to show.controller.update', function() {
81 .withArgs('/:id', 'showCtrl.update')
82 .should.have.been.calledOnce;
87 describe('DELETE /api/shows/:id', function() {
89 it('should route to show.controller.destroy', function() {
91 .withArgs('/:id', 'showCtrl.destroy')
92 .should.have.been.calledOnce;