rspec-webservice_matchers 4.10.0 → 4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +35 -0
- data/HISTORY.md +9 -0
- data/README.md +11 -15
- data/circle.yml +2 -0
- data/lib/rspec/webservice_matchers/enforce_https_everywhere.rb +2 -2
- data/lib/rspec/webservice_matchers/version.rb +2 -1
- data/lib/web_test/be_fast.rb +29 -17
- data/lib/web_test/be_up.rb +1 -1
- data/lib/web_test/util.rb +11 -1
- data/rspec-webservice_matchers.gemspec +8 -8
- data/spec/failure_matchers.rb +16 -0
- data/spec/fixtures/pagespeed.json +3179 -370
- data/spec/rspec/webservice_matchers/protocol_spec.rb +2 -6
- data/spec/rspec/webservice_matchers/public_api_spec.rb +1 -1
- data/spec/rspec/webservice_matchers/redirect_spec.rb +19 -18
- data/spec/rspec/webservice_matchers/ssl_spec.rb +72 -47
- data/spec/spec_helper.rb +3 -54
- data/spec/web_mock_config.rb +54 -0
- data/spec/web_test/be_fast_spec.rb +13 -3
- metadata +39 -37
- data/spec/rspec/webservice_matchers/page_speed_spec.rb +0 -30
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Specs for all of the PageSpeed code and matchers.
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
require 'rspec/webservice_matchers'
|
6
|
-
require 'web_test/util'
|
7
|
-
|
8
|
-
|
9
|
-
SAMPLE_JSON_RESPONSE = 'spec/fixtures/pagespeed.json'
|
10
|
-
|
11
|
-
describe RSpec::WebserviceMatchers::BeFast do
|
12
|
-
describe '#be_fast' do
|
13
|
-
it 'performs a Google PageSpeed Insights API query on a fast site' do
|
14
|
-
expect('nonstop.qa').to be_fast
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'raises a friendly error if the api key has not been set' do
|
18
|
-
# Remove the key
|
19
|
-
key = ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY']
|
20
|
-
ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY'] = nil
|
21
|
-
|
22
|
-
expect {
|
23
|
-
expect('nonstop.qa').not_to be_fast
|
24
|
-
}.to raise_error(RuntimeError, /API key/)
|
25
|
-
|
26
|
-
# Replace the key
|
27
|
-
ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY'] = key
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|