<commit_before>class Ey::Core::Client
  class Real
    def signup(_params)
      params = Cistern::Hash.stringify_keys(_params)

      request(
        :method => :post,
        :path   => "/signups",
        :params => params,
      )
    end
  end # Real

  class Mock
    def signup(_params)
      if self.authentication != :hmac
        response(status: 403)
      end

      params = Cistern::Hash.stringify_keys(_params)

      user_id = self.uuid

      user = params["user"].dup
      user.merge!({
        "id"          => user_id,
        "accounts"    => url_for("/users/#{user_id}/accounts"),
        "memberships" => url_for("/users/#{user_id}/memberships"),
        "keypairs"    => url_for("/users/#{user_id}/keypairs"),
        "token"       => SecureRandom.hex(20)
      })

      self.data[:users][user_id] = user

      account_id = self.uuid

      account = mock_account_setup(account_id, params["account"].dup)

      self.data[:accounts][account_id] = account.merge(:account_users => [user_id], :account_owners => [user_id])

      (params["features"] || []).each do |resource_id|
        feature = self.data[:features][resource_id]

        account_url = url_for("/accounts/#{account_id}")
        feature["account"] = account_url
      end

      response(
        :body => {
          "signup" => {
            "user_id"     => user_id,
            "account_id"  => account_id,
            "upgrade_url" => "http://login.localdev.engineyard.com:9292/session-tokens/#{self.uuid}/upgrade",
          },
        },
        :status  => 201,
      )
    end
  end # Mock
end # Ey::Core::Client
<commit_msg>Fixes signup being sent over url<commit_after>class Ey::Core::Client
  class Real
    def signup(_params)
      params = Cistern::Hash.stringify_keys(_params)

      request(
        :method => :post,
        :path   => "/signups",
        :body   => params,
      )
    end
  end # Real

  class Mock
    def signup(_params)
      if self.authentication != :hmac
        response(status: 403)
      end

      params = Cistern::Hash.stringify_keys(_params)

      user_id = self.uuid

      user = params["user"].dup
      user.merge!({
        "id"          => user_id,
        "accounts"    => url_for("/users/#{user_id}/accounts"),
        "memberships" => url_for("/users/#{user_id}/memberships"),
        "keypairs"    => url_for("/users/#{user_id}/keypairs"),
        "token"       => SecureRandom.hex(20)
      })

      self.data[:users][user_id] = user

      account_id = self.uuid

      account = mock_account_setup(account_id, params["account"].dup)

      self.data[:accounts][account_id] = account.merge(:account_users => [user_id], :account_owners => [user_id])

      (params["features"] || []).each do |resource_id|
        feature = self.data[:features][resource_id]

        account_url = url_for("/accounts/#{account_id}")
        feature["account"] = account_url
      end

      response(
        :body => {
          "signup" => {
            "user_id"     => user_id,
            "account_id"  => account_id,
            "upgrade_url" => "http://login.localdev.engineyard.com:9292/session-tokens/#{self.uuid}/upgrade",
          },
        },
        :status  => 201,
      )
    end
  end # Mock
end # Ey::Core::Client

{'fraction_non_alphanumeric': 0.15337610754659334, 'fraction_numerical': 0.007332722273143905, 'mean_word_length': 2.197265625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '6250052', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1024, 'n_words': 173}