-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1646 from polleverywhere/confidential-skip-auth
Block public clients automatic authorization skip
- Loading branch information
Showing
4 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
# Adds the `render_with` matcher. | ||
# Ex: | ||
# expect(controller).to render_with(template: :show, locals: { alpha: "beta" }) | ||
# | ||
module RenderWithMatcher | ||
def self.included(base) | ||
# Setup spying for our "render_with" matcher | ||
base.before do | ||
allow(controller).to receive(:render).and_wrap_original do |original, *args, **kwargs, &block| | ||
original.call(*args, **kwargs, &block) | ||
end | ||
end | ||
end | ||
|
||
RSpec::Matchers.define :render_with do |expected| | ||
match do |actual| | ||
have_received(:render).with(expected).matches?(actual) | ||
end | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.include RenderWithMatcher, type: :controller | ||
end |