Skip to content

Commit 5b233fe

Browse files
author
vitalie
committed
Fix specs
1 parent a92e03a commit 5b233fe

File tree

10 files changed

+30
-14
lines changed

10 files changed

+30
-14
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ GEM
325325
rb-fsevent (0.9.8)
326326
rb-inotify (0.10.1)
327327
ffi (~> 1.0)
328-
rbtrace (0.4.12)
328+
rbtrace (0.4.14)
329329
ffi (>= 1.0.6)
330330
msgpack (>= 0.4.3)
331331
optimist (>= 3.0.0)

spec/v3/queries/custom_key_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
context 'key with identifier does not exist in user or organization' do
1818
it 'creates custom key' do
19-
expect(described_class.new({}, 'CustomKey').create(params).fingerprint).to eq('57:78:65:c2:c9:c8:c9:f7:dd:2b:35:39:40:27:d2:40')
19+
expect(described_class.new({}, 'CustomKey').create(params, user).fingerprint).to eq('57:78:65:c2:c9:c8:c9:f7:dd:2b:35:39:40:27:d2:40')
2020
end
2121
end
2222

@@ -33,7 +33,7 @@
3333
end
3434

3535
it 'returns error' do
36-
expect { described_class.new({}, 'CustomKey').create(params) }.to raise_error(Travis::API::V3::UnprocessableEntity)
36+
expect { described_class.new({}, 'CustomKey').create(params, user) }.to raise_error(Travis::API::V3::UnprocessableEntity)
3737
end
3838
end
3939

@@ -53,7 +53,7 @@
5353
end
5454

5555
it 'returns error' do
56-
expect { described_class.new({}, 'CustomKey').create(params) }.to raise_error(Travis::API::V3::UnprocessableEntity)
56+
expect { described_class.new({}, 'CustomKey').create(params, user) }.to raise_error(Travis::API::V3::UnprocessableEntity)
5757
end
5858
end
5959
end
@@ -75,7 +75,7 @@
7575

7676
context 'key with identifier does not exist in user or organization' do
7777
it 'creates custom key' do
78-
expect(described_class.new({}, 'CustomKey').create(params).fingerprint).to eq('57:78:65:c2:c9:c8:c9:f7:dd:2b:35:39:40:27:d2:40')
78+
expect(described_class.new({}, 'CustomKey').create(params, user).fingerprint).to eq('57:78:65:c2:c9:c8:c9:f7:dd:2b:35:39:40:27:d2:40')
7979
end
8080
end
8181

@@ -92,7 +92,7 @@
9292
end
9393

9494
it 'returns error' do
95-
expect { described_class.new({}, 'CustomKey').create(params) }.to raise_error(Travis::API::V3::UnprocessableEntity)
95+
expect { described_class.new({}, 'CustomKey').create(params, user) }.to raise_error(Travis::API::V3::UnprocessableEntity)
9696
end
9797
end
9898
end

spec/v3/services/custom_keys/create_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626

2727
describe "creating custom key" do
2828
before { post('/v3/custom_keys', options, headers) }
29-
example { expect(parsed_body).to eql_json({
29+
example { expect(parsed_body.except("id")).to eql_json({
3030
"@type" => "custom_key",
3131
"@representation" => "standard",
32-
"id" => 1,
3332
"name" => "TEST_KEY",
3433
"description" => "",
3534
"public_key" =>

spec/v3/services/installation/find_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@type" => "allowance",
6363
"id" => 1
6464
},
65+
"custom_keys" => [],
6566
"allow_migration" => false,
6667
"recently_signed_up" => false,
6768
"secure_user_hash" => nil,

spec/v3/services/organization/find_spec.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"@type" => "allowance",
2929
"@representation" => "minimal",
3030
"id" => org.id
31-
}
31+
},
32+
"custom_keys" => []
3233
}}
3334
end
3435

@@ -63,7 +64,8 @@
6364
"@type" => "allowance",
6465
"@representation" => "minimal",
6566
"id" => org.id
66-
}
67+
},
68+
"custom_keys" => []
6769
}}
6870
end
6971

spec/v3/services/organizations/for_current_user_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"@type" => "allowance",
6565
"@representation" => "minimal",
6666
"id" => org.id
67-
}
67+
},
68+
"custom_keys" => []
6869
}]
6970
}}
7071
end

spec/v3/services/owner/find_spec.rb

+13-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"@type" => "allowance",
2929
"@representation" => "minimal",
3030
"id" => org.id
31-
}
31+
},
32+
"custom_keys" => []
3233
}}
3334
end
3435

@@ -54,7 +55,8 @@
5455
"@type" => "allowance",
5556
"@representation" => "minimal",
5657
"id" => org.id
57-
}
58+
},
59+
"custom_keys" => []
5860
}}
5961
end
6062

@@ -86,6 +88,7 @@
8688
"@representation" => "minimal",
8789
"id" => org.id
8890
},
91+
"custom_keys" => [],
8992
"repositories" => [{
9093
"@type" => "repository",
9194
"@href" => "/v3/repo/#{repo.id}",
@@ -162,6 +165,7 @@
162165
"@representation" => "minimal",
163166
"id" => org.id
164167
},
168+
"custom_keys" => [],
165169
"repositories" => [{
166170
"@type" => "repository",
167171
"@href" => "/v3/repo/#{repo.id}",
@@ -232,7 +236,8 @@
232236
"@type" => "allowance",
233237
"@representation" => "minimal",
234238
"id" => org.id
235-
}
239+
},
240+
"custom_keys" => []
236241
}}
237242
end
238243

@@ -263,6 +268,7 @@
263268
"@representation" => "minimal",
264269
"id" => org.id
265270
},
271+
"custom_keys" => [],
266272
"@warnings" => [{
267273
"@type" => "warning",
268274
"message" => "query parameter organization.id not safelisted, ignored",
@@ -302,6 +308,7 @@
302308
"@representation" => "minimal",
303309
"id" => user.id
304310
},
311+
"custom_keys" => [],
305312
"recently_signed_up"=>false,
306313
"secure_user_hash" => nil,
307314
"ro_mode" => false,
@@ -334,6 +341,7 @@
334341
"@representation" => "minimal",
335342
"id" => user.id
336343
},
344+
"custom_keys" => [],
337345
"recently_signed_up"=>false,
338346
"secure_user_hash" => nil,
339347
"ro_mode" => false,
@@ -366,6 +374,7 @@
366374
"@representation" => "minimal",
367375
"id" => user.id
368376
},
377+
"custom_keys" => [],
369378
"recently_signed_up"=>false,
370379
"secure_user_hash" => nil,
371380
"ro_mode" => false,
@@ -402,6 +411,7 @@
402411
"@representation" => "minimal",
403412
"id" => user.id
404413
},
414+
"custom_keys" => [],
405415
"recently_signed_up"=>false,
406416
"secure_user_hash" => nil,
407417
"ro_mode" => false,

spec/v3/services/user/current_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@representation" => "minimal",
3131
"id" => user.id
3232
},
33+
"custom_keys" => [],
3334
"recently_signed_up"=>false,
3435
"secure_user_hash" => nil,
3536
"ro_mode" => true,

spec/v3/services/user/find_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@representation" => "minimal",
4343
"id" => user.id
4444
},
45+
"custom_keys" => [],
4546
"recently_signed_up"=>false,
4647
"secure_user_hash" => nil,
4748
"ro_mode" => false,

spec/v3/services/v2_subscription/executions_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"@representation"=>"minimal",
176176
"id"=>1
177177
},
178+
"custom_keys" => [],
178179
"email"=>"[email protected]",
179180
"is_syncing"=>nil,
180181
"synced_at"=>nil,

0 commit comments

Comments
 (0)