Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f6c3b35

Browse files
committed
test($resource): make test for function as param more explicit
Related to aa8d783. Closes #14820
1 parent 6050f0b commit f6c3b35

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/ngResource/resource.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function shallowClearAndCopy(src, dst) {
116116
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
117117
* `actions` methods. If a parameter value is a function, it will be called every time
118118
* a param value needs to be obtained for a request (unless the param was overridden). The function
119-
* will be passed the current data value as a argument.
119+
* will be passed the current data value as an argument.
120120
*
121121
* Each key value in the parameter object is first bound to url template if present and then any
122122
* excess keys are appended to the url search query after the `?`.
@@ -149,7 +149,7 @@ function shallowClearAndCopy(src, dst) {
149149
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
150150
* the parameter value is a function, it will be called every time when a param value needs to
151151
* be obtained for a request (unless the param was overridden). The function will be passed the
152-
* current data value as a argument.
152+
* current data value as an argument.
153153
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
154154
* like for the resource-level urls.
155155
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,

test/ngResource/resourceSpec.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,14 @@ describe("basic usage", function() {
667667

668668
expect(fedor).toEqualData({id: 'fedor', email: '[email protected]', count: 1});
669669

670-
$httpBackend.expect('POST', '/Person/fedor').respond(
671-
{id: 'fedor', email: '[email protected]', count: 2});
670+
$httpBackend.expect('POST', '/Person/fedor2').respond(
671+
{id: 'fedor2', email: '[email protected]', count: 2});
672+
673+
fedor.id = 'fedor2';
672674
fedor.$save();
673675
$httpBackend.flush();
674-
expect(fedor).toEqualData({id: 'fedor', email: '[email protected]', count: 2});
676+
677+
expect(fedor).toEqualData({id: 'fedor2', email: '[email protected]', count: 2});
675678
});
676679

677680

0 commit comments

Comments
 (0)