Skip to content

Commit e8fc0af

Browse files
committed
rubocop
1 parent 52aa189 commit e8fc0af

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

spec/services/urn_lists/api_client_spec.rb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,28 @@
33
RSpec.describe UrnLists::ApiClient do
44
describe '#fetch_rows' do
55
before do
6-
stub_request(:post, "https://example.com/oauth/token")
6+
stub_request(:post, 'https://example.com/oauth/token')
77
.with(
8-
body: {"client_id" => "test_client_id", "client_secret" => "test_client_secret", "grant_type" => "client_credentials", "scope" => "test_scope"},
9-
headers: {
10-
'Accept'=>'*/*',
11-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
12-
'Content-Type'=>'application/x-www-form-urlencoded',
13-
'Host'=>'example.com',
14-
'User-Agent'=>'Ruby'
15-
})
8+
body: { 'client_id' => 'test_client_id', 'client_secret' => 'test_client_secret',
9+
'grant_type' => 'client_credentials', 'scope' => 'test_scope' },
10+
headers: {
11+
'Accept' => '*/*',
12+
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
13+
'Content-Type' => 'application/x-www-form-urlencoded',
14+
'Host' => 'example.com',
15+
'User-Agent' => 'Ruby'
16+
}
17+
)
1618
.to_return(
17-
status: 200,
19+
status: 200,
1820
body: { access_token: 'abc123' }.to_json,
1921
headers: { 'Content-Type' => 'application/json' }
2022
)
2123

2224
stub_request(:get, "https://apim.crowncommercial.gov.uk/website-data/manual/paths/invoke/%5Batt%5D.%5Bvw_RMIActiveURNList%5D/?api-version=2016-10-01&filter=Published%20eq%20'True'&sp=/triggers/manual/run&sv=1.0")
2325
.with(
2426
headers: {
25-
'Accept' => 'application/json',
27+
'Accept' => 'application/json',
2628
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
2729
'Authorization' => 'Bearer abc123',
2830
'User-Agent' => 'Ruby'
@@ -42,11 +44,11 @@
4244
headers: { 'Content-Type' => 'application/json' }
4345
)
4446

45-
allow(ENV).to receive(:fetch).and_call_original
46-
allow(ENV).to receive(:fetch).with('MDM_API_TOKEN_URL').and_return('https://example.com/oauth/token')
47-
allow(ENV).to receive(:fetch).with('MDM_API_CLIENT_ID').and_return('test_client_id')
48-
allow(ENV).to receive(:fetch).with('MDM_API_CLIENT_SECRET').and_return('test_client_secret')
49-
allow(ENV).to receive(:fetch).with('MDM_API_SCOPE').and_return('test_scope')
47+
allow(ENV).to receive(:fetch).and_call_original
48+
allow(ENV).to receive(:fetch).with('MDM_API_TOKEN_URL').and_return('https://example.com/oauth/token')
49+
allow(ENV).to receive(:fetch).with('MDM_API_CLIENT_ID').and_return('test_client_id')
50+
allow(ENV).to receive(:fetch).with('MDM_API_CLIENT_SECRET').and_return('test_client_secret')
51+
allow(ENV).to receive(:fetch).with('MDM_API_SCOPE').and_return('test_scope')
5052
end
5153

5254
it 'fetches and returns customer data' do

0 commit comments

Comments
 (0)