-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource.js
51 lines (29 loc) · 1.02 KB
/
resource.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Vue from 'vue';
describe('this.$resource', function () {
it('get({file: "valid.json"})', (done) => {
var vm = new Vue({
created() {
var resource = this.$resource('data{/file}');
resource.get({file: 'valid.json'}).then((res) => {
expect(res.ok).toBe(true);
expect(res.status).toBe(200);
expect(res.data.foo).toBe('bar');
done();
});
}
});
});
it('save({file: "valid.json"}, {foo: "bar"})', (done) => {
var vm = new Vue({
created() {
var resource = this.$resource('data{/file}');
resource.save({file: 'valid.json'}, {foo: 'bar'}).then((res) => {
expect(res.ok).toBe(true);
expect(res.status).toBe(200);
expect(res.data.foo).toBe('bar');
done();
});
}
});
});
});