|
5 | 5 | include_context 'set environment' |
6 | 6 |
|
7 | 7 | it 'does not fail with cascadeCreate' do |
8 | | - dv = described_class.new('u_id', 'i_id', 0, 1, 'cascadeCreate' => true) |
| 8 | + dv = described_class.new('u_id', 'i_id', 1, 'cascadeCreate' => true) |
9 | 9 | expect { @client.send(dv) }.not_to raise_exception |
10 | 10 | end |
11 | 11 |
|
12 | 12 | it 'does not fail with existing item and user' do |
13 | | - dv = described_class.new('entity_id', 'entity_id', 0, 0) |
| 13 | + dv = described_class.new('entity_id', 'entity_id', 0) |
14 | 14 | expect { @client.send(dv) }.not_to raise_exception |
15 | 15 | end |
16 | 16 |
|
17 | 17 | it 'fails with nonexisting item id' do |
18 | | - dv = described_class.new('entity_id', 'i_id', 0, -1) |
| 18 | + dv = described_class.new('entity_id', 'i_id', -1) |
19 | 19 | expect { @client.send(dv) }.to raise_exception { |exception| |
20 | 20 | expect(exception).to be_a(RecombeeApiClient::ResponseError) |
21 | 21 | expect(exception.status_code).to eq 404 |
22 | 22 | } |
23 | 23 | end |
24 | 24 |
|
25 | 25 | it 'fails with nonexisting user id' do |
26 | | - dv = described_class.new('u_id', 'entity_id', 0, 0.5) |
| 26 | + dv = described_class.new('u_id', 'entity_id', 0.5) |
27 | 27 | expect { @client.send(dv) }.to raise_exception { |exception| |
28 | 28 | expect(exception).to be_a(RecombeeApiClient::ResponseError) |
29 | 29 | expect(exception.status_code).to eq 404 |
30 | 30 | } |
31 | 31 | end |
32 | 32 |
|
33 | 33 | it 'fails with invalid time' do |
34 | | - dv = described_class.new('entity_id', 'entity_id', -15, 0) |
| 34 | + dv = described_class.new('entity_id', 'entity_id', 0, 'timestamp' => -15) |
35 | 35 | expect { @client.send(dv) }.to raise_exception { |exception| |
36 | 36 | expect(exception).to be_a(RecombeeApiClient::ResponseError) |
37 | 37 | expect(exception.status_code).to eq 400 |
38 | 38 | } |
39 | 39 | end |
40 | 40 |
|
41 | 41 | it 'fails with invalid rating' do |
42 | | - dv = described_class.new('entity_id', 'entity_id', 15, -2) |
| 42 | + dv = described_class.new('entity_id', 'entity_id', -2) |
43 | 43 | expect { @client.send(dv) }.to raise_exception { |exception| |
44 | 44 | expect(exception).to be_a(RecombeeApiClient::ResponseError) |
45 | 45 | expect(exception.status_code).to eq 400 |
46 | 46 | } |
47 | 47 | end |
48 | 48 |
|
49 | 49 | it 'really stores interaction to the system' do |
50 | | - dv = described_class.new('u_id', 'i_id', 0, 0.3, 'cascadeCreate' => true) |
| 50 | + dv = described_class.new('u_id', 'i_id', 0.3, {'cascadeCreate' => true, 'timestamp' => 5}) |
51 | 51 | expect { @client.send(dv) }.not_to raise_exception |
52 | 52 | expect { @client.send(dv) }.to raise_exception { |exception| |
53 | 53 | expect(exception).to be_a(RecombeeApiClient::ResponseError) |
|
0 commit comments