# frozen_string_literal: true module SuperIdentity # Mixin for stubbing IdE during test suites module TestStub def stub_ide(shared_token:, entitlements: [], **) host = ide_config[:host] url = "https://#{host}/api/subjects/#{shared_token}/attributes" attrs = entitlements.map do |v| { name: 'eduPersonEntitlement', value: v } end json = JSON.generate(attributes: attrs) WebMock::API.stub_request(:get, url).to_return(status: 200, body: json) end end end