|
4 | 4 | before do
|
5 | 5 | @client = oauth_client
|
6 | 6 | @sarif_id = 'fb31fa2c-095d-11ee-98fe-c609abca1772'
|
7 |
| - @code_scanning_test_repo = "Caja-de-Dano/active-wrapper" |
| 7 | + @code_scanning_test_repo = 'Caja-de-Dano/active-wrapper' |
8 | 8 | end
|
9 | 9 |
|
10 | 10 | describe '.list_code_scanning_alerts_for_org', :vcr do
|
11 | 11 | it 'lists code scanning alerts for an organization' do
|
12 |
| - scanning_alerts = @client.list_code_scanning_alerts_for_org("caja-de-dano") |
| 12 | + scanning_alerts = @client.list_code_scanning_alerts_for_org('caja-de-dano') |
13 | 13 | expect(scanning_alerts).to be_kind_of Array
|
14 | 14 | expect(scanning_alerts.first.state).to eq('open')
|
15 |
| - assert_requested :get, github_url("/orgs/caja-de-dano/code-scanning/alerts") |
| 15 | + assert_requested :get, github_url('/orgs/caja-de-dano/code-scanning/alerts') |
16 | 16 | end
|
17 | 17 | end
|
18 | 18 |
|
19 | 19 | describe '.list_code_scanning_alerts_for_repository', :vcr do
|
20 | 20 | it 'lists code scanning alerts for a repository' do
|
21 | 21 | scanning_alerts = @client.list_code_scanning_alerts_for_repo(@code_scanning_test_repo)
|
| 22 | + expect(scanning_alerts).to be_kind_of Array |
22 | 23 | assert_requested :get, github_url("/repos/#{@code_scanning_test_repo}/code-scanning/alerts")
|
23 | 24 | end
|
24 | 25 | end
|
|
58 | 59 |
|
59 | 60 | describe '.get_code_scanning_analysis', :vcr do
|
60 | 61 | it 'gets a specific code scanning analysis for a repo' do
|
61 |
| - analysis = @client.get_code_scanning_analysis(@code_scanning_test_repo, 225379147) |
| 62 | + analysis = @client.get_code_scanning_analysis(@code_scanning_test_repo, 225_379_147) |
62 | 63 | expect(analysis.tool.name).to eq('CodeQL')
|
63 |
| - expect(analysis.id).to eq(225379147) |
| 64 | + expect(analysis.id).to eq(225_379_147) |
64 | 65 | assert_requested :get, github_url("/repos/#{@code_scanning_test_repo}/code-scanning/analyses/225379147")
|
65 | 66 | end
|
66 | 67 | end
|
67 | 68 |
|
68 | 69 | describe '.delete_code_scanning_analysis', :vcr do
|
69 | 70 | it 'deletes a code scanning analysis' do
|
70 |
| - analysis = @client.delete_code_scanning_analysis(@code_scanning_test_repo, 225379147) |
| 71 | + analysis = @client.delete_code_scanning_analysis(@code_scanning_test_repo, 225_379_147) |
71 | 72 | expect(analysis.confirm_delete_url).to eq("#{analysis.next_analysis_url}?confirm_delete")
|
72 | 73 | assert_requested :delete, github_url("/repos/#{@code_scanning_test_repo}/code-scanning/analyses/225379147")
|
73 | 74 | end
|
|
93 | 94 | describe '.get_code_scanning_default_config', :vcr do
|
94 | 95 | it 'gets the default code scanning configuration for a repository' do
|
95 | 96 | default_config = @client.get_code_scanning_default_config(@code_scanning_test_repo)
|
96 |
| - expect(default_config.state).to eq("configured") |
97 |
| - expect(default_config.query_suite).to eq("default") |
98 |
| - expect(default_config.languages).to eq(["python"]) |
| 97 | + expect(default_config.state).to eq('configured') |
| 98 | + expect(default_config.query_suite).to eq('default') |
| 99 | + expect(default_config.languages).to eq(['python']) |
99 | 100 | assert_requested :get, github_url("/repos/#{@code_scanning_test_repo}/code-scanning/default-setup")
|
100 | 101 | end
|
101 | 102 | end
|
102 | 103 |
|
103 | 104 | describe '.update_code_scanning_default_config', :vcr do
|
104 | 105 | it 'updates the default code scanning configuration for a repository' do
|
105 |
| - default_config = @client.update_code_scanning_default_config(@code_scanning_test_repo, "configured") |
| 106 | + default_config = @client.update_code_scanning_default_config(@code_scanning_test_repo, 'configured') |
106 | 107 | expect(default_config.run_id).to be_kind_of Integer
|
107 | 108 | expect(default_config.run_url).to eq("https://api.github.com/repos/#{@code_scanning_test_repo}/actions/runs/#{default_config.run_id}")
|
108 | 109 | assert_requested :patch, github_url("/repos/#{@code_scanning_test_repo}/code-scanning/default-setup")
|
|
0 commit comments