Closed ragesoss closed 8 years ago
I was able to make it work like so:
OmniAuth.config.test_mode = true
allow_any_instance_of(OmniAuth::Strategies::Mediawiki)
.to receive(:callback_url).and_return('/users/auth/mediawiki/callback')
OmniAuth.config.mock_auth[:mediawiki] = OmniAuth::AuthHash.new(
provider: 'mediawiki',
uid: '12345',
info: { name: 'Ragesock' },
credentials: { token: 'foo', secret: 'bar' }
)
Here it is in context: https://github.com/WikiEducationFoundation/WikiEduDashboard/commit/599629cd8616c2bea501f60750bb9e815b962829
:smile:
Awesome, many thanks! glad it worked. I'll try to add it to the readme soon, I've also some better examples of how to use the gem to call the API which I want to add to the readme (see https://github.com/timwaters/mediawiki-oauth-api-hack for my scratch pad at this)
Hi! First off, thanks for this gem, which I've found very useful in my project.
I've tried several times to get an integration test working with MediaWiki login, but I always get stuck.
With
OmniAuth.config.test_mode = true
, the login path errors like this:Any ideas on how to get the full login process working in an integration test?