-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register subclasses with OmniAuth.strategies #95
Register subclasses with OmniAuth.strategies #95
Conversation
@@ -222,4 +222,13 @@ def post_xml(xml=:example_response) | |||
it 'implements #on_metadata_path?' do | |||
expect(described_class.new(nil)).to respond_to(:on_metadata_path?) | |||
end | |||
|
|||
describe 'subclasses' do | |||
let(:subclass) { Class.new(described_class) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of declaring the subclass
in a let
can we just initialize it within the it
block?
it 'registers subclasses in OmniAuth.strategies' do
subclass = Class.new(described_class) # or described_class.new
expect(OmniAuth.strategies).to include(subclass)
end
I find this approach easier to read as it defines everything the test needs within the test itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and amended. I also threw described_class
into the include
check since omniauth-oauth2
is doing that check and it seems reasonable.
These |
@md5 I agree. We should move them back to the |
@supernova32 Updated in f74d983 to allow failures of |
This PR updates
OmniAuth::Strategies::SAML
to register any subclasses as strategies with OmniAuth. This parallels what's done in theomniauth-oauth2
gem (cf. here).