<commit_before>module Omniauth
  module Dsds
    module Spec
      module SignInHelper

        def mock_token(token: "ABCDEF")
          OmniAuth.config.test_mode = true

          OmniAuth.config.mock_auth[:defence_request] = OmniAuth::AuthHash.new({
            provider: "defence_request",
            uid: "12345678-abcd-1234-abcd-1234567890",
            credentials: {
              token: token,
            }
          })
        end

        def mock_profile(options: {}, authentication_site_url: "http://app.example.com")
          response_body = {
            "user" => {
              "email" => "<EMAIL>",
            },
            "profile" => {
              "name" => options.fetch(:name) { "<NAME>" },
              "email" => options.fetch(:email) { "<EMAIL>" },
              "telephone" => options.fetch(:telephone) { "0123456789" },
              "mobile" => options.fetch(:mobile) { "071234567" },
              "address" => {
                "full_address" => options.fetch(:full_address) { "" },
                "postcode" => options.fetch(:postcode) { "" }
              },
              "PIN" => options.fetch(:pin) { "1234" },
              "organisation_uids" => options.fetch(:organisation_uids) { ["12345678-bcde-1234-abcd-1234567890","12345678-cdef-1234-abcd-1234567890"] },
              "uid" =>  options.fetch(:uid) { "12345678-abcd-1234-abcd-1234567890" }
            },
            "roles" => options.fetch(:roles) { ["admin", "foo", "bar"] }
          }.to_json

          WebMock.stub_request(:get, authentication_site_url+'/api/v1/profiles/me').
            to_return(status: 200, body: response_body, headers: {} )
        end
      end
    end
  end
end<commit_msg>update test helper to reflect auth app changes to remove profiles<commit_after>module Omniauth
  module Dsds
    module Spec
      module SignInHelper

        def mock_token(token: "ABCDEF")
          OmniAuth.config.test_mode = true

          OmniAuth.config.mock_auth[:defence_request] = OmniAuth::AuthHash.new({
            provider: "defence_request",
            uid: "12345678-abcd-1234-abcd-1234567890",
            credentials: {
              token: token,
            }
          })
        end

        def mock_profile(options: {}, authentication_site_url: "http://app.example.com")
          response_body = {
            "user" => {
              "name" => options.fetch(:name) { "<NAME>" },
              "email" => options.fetch(:email) { "<EMAIL>" },
              "telephone" => options.fetch(:telephone) { "0123456789" },
              "mobile" => options.fetch(:mobile) { "071234567" },
              "address" => {
                "full_address" => options.fetch(:full_address) { "" },
                "postcode" => options.fetch(:postcode) { "" }
              },
              "PIN" => options.fetch(:pin) { "1234" },
              "organisation_uids" => options.fetch(:organisation_uids) { ["12345678-bcde-1234-abcd-1234567890","12345678-cdef-1234-abcd-1234567890"] },
              "uid" =>  options.fetch(:uid) { "12345678-abcd-1234-abcd-1234567890" }
            },
            "roles" => options.fetch(:roles) { ["admin", "foo", "bar"] }
          }.to_json

          WebMock.stub_request(:get, authentication_site_url+'/api/v1/me').
            to_return(status: 200, body: response_body, headers: {} )
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.15282293822051435, 'fraction_numerical': 0.06798699379249187, 'mean_word_length': 1.9248055315471047, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4878986', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1007, 'n_words': 158}