- Run
main_api.rb
(ruby main_api.rb
) - Run
proxy_api.rb
(ruby proxy_api.rb
) - Open browser and go to
http://localhost:3001/test
- See infinite load :(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
RSpec::Matchers.define :exceed_query_limit do |expected, pattern = nil| | |
supports_block_expectations | |
match do |block| | |
query_count(pattern, &block) > expected | |
end | |
failure_message_when_negated do |actual| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
source 'https://rubygems.org' | |
gem 'grape_oauth2', git: 'https://github.com/nbulaj/grape_oauth2.git' | |
gem 'grape', '~> 1.0' | |
gem 'rack-oauth2' | |
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/rails_helper.rb or spec/spec_helper.rb | |
# ... | |
# require custom matchers from the "support" directory: | |
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } | |
# ----- | |
# support/matchers/be_success.rb | |
RSpec::Matchers.define :be_success do | |
match do |actual| |