From 8fd11d9c7414651542cbf87071e77f02aa9dd23b Mon Sep 17 00:00:00 2001 From: David Haslem Date: Mon, 22 Sep 2014 18:31:30 -0700 Subject: [PATCH 1/2] Expose other form info with props This makes the api more like hyperagent links/embeds --- lib/hyperagent-forms/form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/hyperagent-forms/form.js b/lib/hyperagent-forms/form.js index 11439d2..8eca6be 100644 --- a/lib/hyperagent-forms/form.js +++ b/lib/hyperagent-forms/form.js @@ -83,6 +83,7 @@ Form.factory = function (object, options) { } FormFactory.schema = object.schema; + FormFactory.props = object; return FormFactory; }; From d360f7eb81fa0df9c2903ceba21cea41502cae93 Mon Sep 17 00:00:00 2001 From: David Haslem Date: Mon, 22 Sep 2014 18:33:27 -0700 Subject: [PATCH 2/2] Test for changes --- test/spec/test-resource.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/test-resource.js b/test/spec/test-resource.js index b2c05ad..a8ed4ba 100644 --- a/test/spec/test-resource.js +++ b/test/spec/test-resource.js @@ -29,6 +29,7 @@ }); assert.property(agent.forms, 'create'); + assert.equal(agent.forms.create.props.method, 'POST'); }); it('should absolutize form hrefs', function () {