From f5ea8e10b0208cf546e6a7e75d7cb7b5b1d93233 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Tue, 26 Jan 2016 08:51:38 +0100 Subject: [PATCH 1/2] fix(controller): add one restful method --- src/Generators/Controller.js | 2 +- src/Generators/strings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generators/Controller.js b/src/Generators/Controller.js index a3f7224..fc40e6b 100644 --- a/src/Generators/Controller.js +++ b/src/Generators/Controller.js @@ -10,7 +10,7 @@ const utils = require('./helpers') const path = require('path') const Ioc = require('adonis-fold').Ioc const controllerString = require('./strings').controller -const methods = ['index', 'create', 'store', 'show', 'update', 'destroy'] +const methods = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy'] let Controller = exports = module.exports = {} diff --git a/src/Generators/strings.js b/src/Generators/strings.js index f46e2e8..0c99607 100644 --- a/src/Generators/strings.js +++ b/src/Generators/strings.js @@ -34,7 +34,7 @@ module.exports = {{name}} strings.controller = `'use strict' class {{name}} { - {{index}}{{create}}{{store}}{{show}}{{update}}{{destroy}} + {{index}}{{create}}{{store}}{{show}}{{edit}}{{update}}{{destroy}} } module.exports = {{name}} From 994aec2683dc4f2824d0ebb3608d59817c9a7449 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Tue, 26 Jan 2016 10:31:25 +0100 Subject: [PATCH 2/2] test(controller): change test according to the new method --- test/commands.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/commands.spec.js b/test/commands.spec.js index 1de4304..c557006 100644 --- a/test/commands.spec.js +++ b/test/commands.spec.js @@ -159,6 +159,7 @@ describe('Generators', function () { expect(user.show).to.be.a('function') expect(user.create).to.be.a('function') expect(user.store).to.be.a('function') + expect(user.edit).to.be.a('function') expect(user.update).to.be.a('function') expect(user.destroy).to.be.a('function') }) @@ -171,6 +172,7 @@ describe('Generators', function () { expect(accounts.create).to.equal(undefined) expect(accounts.store).to.equal(undefined) expect(accounts.show).to.equal(undefined) + expect(accounts.edit).to.equal(undefined) expect(accounts.update).to.equal(undefined) expect(accounts.destroy).to.equal(undefined) })