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

Commit 70fcffc

Browse files
committed
test($resource): make test for function as param more explicit
Related to aa8d783. Closes #14820
1 parent 181e440 commit 70fcffc

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
@@ -650,11 +650,14 @@ describe("basic usage", function() {
650650

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

653-
$httpBackend.expect('POST', '/Person/fedor').respond(
654-
{id: 'fedor', email: '[email protected]', count: 2});
653+
$httpBackend.expect('POST', '/Person/fedor2').respond(
654+
{id: 'fedor2', email: '[email protected]', count: 2});
655+
656+
fedor.id = 'fedor2';
655657
fedor.$save();
656658
$httpBackend.flush();
657-
expect(fedor).toEqualData({id: 'fedor', email: '[email protected]', count: 2});
659+
660+
expect(fedor).toEqualData({id: 'fedor2', email: '[email protected]', count: 2});
658661
});
659662

660663

0 commit comments

Comments
 (0)