Sha256: 9dd68621ee4a496fb903862f0744734ff79ea608e0acc10a0609690459baf191

Contents?: true

Size: 1.39 KB

Versions: 49

Compression:

Stored size: 1.39 KB

Contents

describe KnapsackPro::Client::API::V1::Queues do
  describe '.queue' do
    let(:fixed_queue_split) { double }
    let(:can_initialize_queue) { double }
    let(:commit_hash) { double }
    let(:branch) { double }
    let(:node_total) { double }
    let(:node_index) { double }
    let(:test_files) { double }

    subject do
      described_class.queue(
        can_initialize_queue: can_initialize_queue,
        commit_hash: commit_hash,
        branch: branch,
        node_total: node_total,
        node_index: node_index,
        test_files: test_files
      )
    end

    before do
      expect(KnapsackPro::Config::Env).to receive(:fixed_queue_split).and_return(fixed_queue_split)
    end

    it do
      node_build_id = double
      expect(KnapsackPro::Config::Env).to receive(:ci_node_build_id).and_return(node_build_id)

      action = double
      expect(KnapsackPro::Client::API::Action).to receive(:new).with({
        endpoint_path: '/v1/queues/queue',
        http_method: :post,
        request_hash: {
          fixed_queue_split: fixed_queue_split,
          can_initialize_queue: can_initialize_queue,
          commit_hash: commit_hash,
          branch: branch,
          node_total: node_total,
          node_index: node_index,
          node_build_id: node_build_id,
          test_files: test_files
        }
      }).and_return(action)
      expect(subject).to eq action
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
knapsack_pro-1.8.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.7.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.6.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.5.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.4.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.3.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.2.1 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.2.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.1.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.0.2 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.0.1 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-1.0.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.57.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.56.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.55.2 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.55.1 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.55.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.54.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.53.0 spec/knapsack_pro/client/api/v1/queues_spec.rb
knapsack_pro-0.52.0 spec/knapsack_pro/client/api/v1/queues_spec.rb