From 8e274f7296e4da68b591ce4d4299fece850e0492 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 25 Oct 2018 11:46:34 +0200 Subject: [PATCH] UX: bumps the user-api-key version to 3 (#6526) * UX: bumps the user-api-key version to 3 * fix spec --- app/controllers/user_api_keys_controller.rb | 2 +- spec/requests/user_api_keys_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/user_api_keys_controller.rb b/app/controllers/user_api_keys_controller.rb index 498a055e5d0..44c3efe1327 100644 --- a/app/controllers/user_api_keys_controller.rb +++ b/app/controllers/user_api_keys_controller.rb @@ -6,7 +6,7 @@ class UserApiKeysController < ApplicationController skip_before_action :redirect_to_login_if_required, only: [:new] skip_before_action :check_xhr, :preload_json - AUTH_API_VERSION ||= 2 + AUTH_API_VERSION ||= 3 def new diff --git a/spec/requests/user_api_keys_controller_spec.rb b/spec/requests/user_api_keys_controller_spec.rb index 34fc6c898bc..ddaedd25896 100644 --- a/spec/requests/user_api_keys_controller_spec.rb +++ b/spec/requests/user_api_keys_controller_spec.rb @@ -48,7 +48,7 @@ describe UserApiKeysController do it "supports a head request cleanly" do head "/user-api-key/new" expect(response.status).to eq(200) - expect(response.headers["Auth-Api-Version"]).to eq("2") + expect(response.headers["Auth-Api-Version"]).to eq("3") end end @@ -156,7 +156,7 @@ describe UserApiKeysController do expect(parsed["nonce"]).to eq(args[:nonce]) expect(parsed["push"]).to eq(false) - expect(parsed["api"]).to eq(2) + expect(parsed["api"]).to eq(3) key = user.user_api_keys.first expect(key.scopes).to include("push")