|
40 | 40 |
|
41 | 41 | user_id = 'user_id'
|
42 | 42 | message = {
|
43 |
| - 'type' => 'location', |
44 |
| - 'title' => 'LINE Corporation.', |
45 |
| - 'address' => 'Hikarie Shibuya-ku Tokyo 151-0002', |
46 |
| - 'latitude' => 35.61823286112982, |
47 |
| - 'longitude' => 139.72824096679688, |
| 43 | + type: 'location', |
| 44 | + title: 'LINE Corporation.', |
| 45 | + address: 'Hikarie Shibuya-ku Tokyo 151-0002', |
| 46 | + latitude: 35.61823286112982, |
| 47 | + longitude: 139.72824096679688, |
48 | 48 | }
|
49 |
| - response = client.push_message(user_id, message, payload: {'customAggregationUnits' => ['test']}) |
| 49 | + response = client.push_message(user_id, message, payload: {customAggregationUnits: ['test']}) |
50 | 50 |
|
51 | 51 | expected = {
|
52 |
| - 'to' => user_id, |
53 |
| - 'messages' => [ |
| 52 | + customAggregationUnits: ['test'], |
| 53 | + to: user_id, |
| 54 | + messages: [ |
54 | 55 | message
|
55 |
| - ], |
56 |
| - 'customAggregationUnits' => ['test'] |
57 |
| - } |
58 |
| - expect(JSON.parse(response.body)).to eq(expected) |
| 56 | + ] |
| 57 | + }.to_json |
| 58 | + expect(response.body).to eq(expected) |
59 | 59 | end
|
60 | 60 |
|
61 | 61 | it 'replies the location message' do
|
|
122 | 122 |
|
123 | 123 | user_ids = ['user1', 'user2']
|
124 | 124 | message = {
|
125 |
| - 'type' => 'location', |
126 |
| - 'title' => 'LINE Corporation.', |
127 |
| - 'address' => 'Hikarie Shibuya-ku Tokyo 151-0002', |
128 |
| - 'latitude' => 35.61823286112982, |
129 |
| - 'longitude' => 139.72824096679688, |
| 125 | + type: 'location', |
| 126 | + title: 'LINE Corporation.', |
| 127 | + address: 'Hikarie Shibuya-ku Tokyo 151-0002', |
| 128 | + latitude: 35.61823286112982, |
| 129 | + longitude: 139.72824096679688, |
130 | 130 | }
|
131 |
| - response = client.multicast(user_ids, message, payload: {'customAggregationUnits' => ['test']}) |
| 131 | + response = client.multicast(user_ids, message, payload: {customAggregationUnits: ['test']}) |
132 | 132 |
|
133 | 133 | expected = {
|
134 |
| - 'to' => user_ids, |
135 |
| - 'messages' => [ |
| 134 | + customAggregationUnits: ['test'], |
| 135 | + to: user_ids, |
| 136 | + messages: [ |
136 | 137 | message
|
137 |
| - ], |
138 |
| - 'customAggregationUnits' => ['test'] |
139 |
| - } |
140 |
| - expect(JSON.parse(response.body)).to eq(expected) |
| 138 | + ] |
| 139 | + }.to_json |
| 140 | + expect(response.body).to eq(expected) |
141 | 141 | end
|
142 | 142 | end
|
0 commit comments