<commit_before># frozen_string_literal: true

require 'spec_helper'

describe Evostream::Action, type: :request, broken: true do
  let(:action) { Evostream::Action.new(payload) }
  let(:payload) { {} }

  it 'should be a hash' do
    expect(action.instance_variable_get(:@payload)).to be_kind_of(Hash)
  end

  describe 'push_stream' do
    let(:action_name) { 'pushStream' }
    let(:payload) do
      {
        uri: 'rtmp://rtmp-api.facebook.com:80/rtmp',
        target_stream_name: '151146928743762?ds=1&s_l=1&a=AThF12FC86-ffgS5',
        local_stream_name: 'top'
      }
    end

    include_examples 'test request action'
  end

  describe 'remove_config' do
    let(:action_name) { 'removeConfig' }
    let(:payload) { { id: Faker::Number.between(1, 999_999) } }

    include_examples 'test request action'
  end
end<commit_msg>Add test with custom evostream url<commit_after># frozen_string_literal: true

require 'spec_helper'

describe Evostream::Action, type: :request do
  let(:action) { Evostream::Action.new(payload) }
  let(:payload) { {} }

  it 'should be a hash' do
    expect(action.instance_variable_get(:@payload)).to be_kind_of(Hash)
  end

  describe 'push_stream' do
    let(:action_name) { 'pushStream' }
    let(:payload) do
      {
        uri: 'rtmp://rtmp-api.facebook.com:80/rtmp',
        target_stream_name: '151146928743762?ds=1&s_l=1&a=AThF12FC86-ffgS5',
        local_stream_name: 'top'
      }
    end

    context 'global Evostream variable' do
      include_examples 'test request action'
    end

    context 'local Evostream variable' do
      let(:action) { Evostream::Action.new(payload, 'evostream.dazzl.local') }

      include_examples 'test request action'
    end
  end

  describe 'remove_config' do
    let(:action_name) { 'removeConfig' }
    let(:payload) { { id: Faker::Number.between(1, 999_999) } }

    context 'global Evostream variable' do
      include_examples 'test request action'
    end

    context 'local Evostream variable' do
      let(:action) { Evostream::Action.new(payload, 'evostream.dazzl.local') }

      include_examples 'test request action'
    end
  end
end
{'fraction_non_alphanumeric': 0.12177985948477751, 'fraction_numerical': 0.029039812646370025, 'mean_word_length': 3.603448275862069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1541722', 'n_tokens_mistral': 769, 'n_tokens_neox': 714, 'n_words': 156}