From 00784d395c1c10c432fb76db1a03d5331d424f4e Mon Sep 17 00:00:00 2001 From: zaru Date: Fri, 7 Jun 2019 00:09:45 +0900 Subject: [PATCH 1/2] Fixed spec --- lib/webpush/request.rb | 2 +- spec/webpush/request_spec.rb | 4 ++-- spec/webpush_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/webpush/request.rb b/lib/webpush/request.rb index a32f50c..0c47880 100644 --- a/lib/webpush/request.rb +++ b/lib/webpush/request.rb @@ -6,7 +6,7 @@ module Webpush # It is temporary URL until supported by the GCM server. GCM_URL = 'https://android.googleapis.com/gcm/send'.freeze - TEMP_GCM_URL = 'https://fcm.googleapis.com/fcm/'.freeze + TEMP_GCM_URL = 'https://fcm.googleapis.com/fcm'.freeze # rubocop:disable Metrics/ClassLength class Request diff --git a/spec/webpush/request_spec.rb b/spec/webpush/request_spec.rb index 802a6fd..b4b89bf 100644 --- a/spec/webpush/request_spec.rb +++ b/spec/webpush/request_spec.rb @@ -37,10 +37,10 @@ def build_request_with_api_key(endpoint, options = {}) expect(request.headers['Authorization']).to eq('key=api_key') end - it 'does not insert Authorization header for Chrome\'s new standards-compliant endpoints, even if api_key is present' do + it 'insert Authorization header for Chrome\'s new standards-compliant endpoints, even if api_key is present' do request = build_request_with_api_key('https://fcm.googleapis.com/fcm/send/ABCD1234', api_key: 'api_key') - expect(request.headers['Authorization']).to be_nil + expect(request.headers['Authorization']).to eq('key=api_key') end it 'does not insert Authorization header when endpoint is not for Chrome, even if api_key is present' do diff --git a/spec/webpush_spec.rb b/spec/webpush_spec.rb index 3be78f2..ee44d51 100644 --- a/spec/webpush_spec.rb +++ b/spec/webpush_spec.rb @@ -208,7 +208,7 @@ context 'chrome GCM endpoint: request headers with GCM api key' do let(:endpoint) { 'https://android.googleapis.com/gcm/send/subscription-id' } - let(:expected_endpoint) { 'https://gcm-http.googleapis.com/gcm/subscription-id' } + let(:expected_endpoint) { 'https://fcm.googleapis.com/fcm/subscription-id' } let(:message) { JSON.generate(body: 'body') } let(:p256dh) { 'BN4GvZtEZiZuqFxSKVZfSfluwKBD7UxHNBmWkfiZfCtgDE8Bwh-_MtLXbBxTBAWH9r7IPKL0lhdcaqtL1dfxU5E=' } From 93803253ec6df4214e429225f7306623748158e6 Mon Sep 17 00:00:00 2001 From: zaru Date: Fri, 7 Jun 2019 00:25:17 +0900 Subject: [PATCH 2/2] fixed bundler version at travis --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60ba85d..d5433c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,7 @@ rvm: - 2.5 - 2.6 before_install: - - | - if [[ ${RUBY_VERSION} =~ ^ruby-2.5 ]]; then - gem uninstall -i /home/travis/.rvm/gems/${RUBY_VERSION}@global bundler -x - fi + - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true - gem install bundler -v 1.17.3 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter