mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
still no luck
This commit is contained in:
@@ -72,7 +72,8 @@ class DfcRequest
|
||||
# It results in an empty config hash and we lose our config.
|
||||
)
|
||||
client = strategy.client
|
||||
client.token_endpoint = strategy.config.token_endpoint # tried to mock this but doesn't work.
|
||||
binding.pry
|
||||
client.token_endpoint = strategy.config.token_endpoint # can't work out what's happening under the hood or how to stub it
|
||||
client.refresh_token = @user.oidc_account.refresh_token
|
||||
|
||||
token = client.access_token!
|
||||
|
||||
@@ -93,7 +93,11 @@ RSpec.describe DfcRequest do
|
||||
before do
|
||||
stub_request(:get, "http://example.net/api").
|
||||
to_return(status: 401)
|
||||
allow_any_instance_of(OpenIDConnect::Client).to receive(:config).and_return(double(token_endpoint: ""))
|
||||
|
||||
# allow_any_instance_of(OpenIDConnect::Client).to receive(:config).and_return(double(token_endpoint: ""))
|
||||
stub_request(:get, "https://login.lescommuns.org/auth/realms/data-food-consortium/.well-known/openid-configuration").
|
||||
to_return(status: 200, body: {token_endpoint: "/token"}.to_json)
|
||||
|
||||
|
||||
account.refresh_token = ENV.fetch("OPENID_REFRESH_TOKEN")
|
||||
account.token = "anything"
|
||||
|
||||
Reference in New Issue
Block a user