spec/railtie_spec.rb in api-auth-2.4.1 vs spec/railtie_spec.rb in api-auth-2.5.0

- old
+ new

@@ -1,16 +1,16 @@ -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') +require 'spec_helper' describe 'Rails integration' do API_KEY_STORE = { '1044' => 'l16imAXie1sRMcJODpOG7UwC1VyoqvO13jejkfpKWX4Z09W8DC9IrU23DvCwMry7pgSFW6c5S1GIfV0OY6F/vUA==' }.freeze describe 'Rails controller integration' do class ApplicationController < ActionController::Base private def require_api_auth - if (access_id = get_api_access_id_from_request) - return true if api_authenticated?(API_KEY_STORE[access_id]) + if (access_id = get_api_access_id_from_request) && api_authenticated?(API_KEY_STORE[access_id]) + return true end respond_to do |format| format.xml { render xml: 'You are unauthorized to perform this action.', status: 401 } format.json { render json: 'You are unauthorized to perform this action.', status: 401 }