Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dag_pipeline_serializer_spec.rb « ci « serializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 856f6760d5de534078f9bf0fa9ac094e857ea222 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Ci::DagPipelineSerializer do
  describe '#represent' do
    subject { described_class.new.represent(pipeline) }

    let(:pipeline) { create(:ci_pipeline) }
    let!(:job) { create(:ci_build, pipeline: pipeline) }

    it 'includes stages' do
      expect(subject[:stages]).to be_present
      expect(subject[:stages].size).to eq 1
    end

    it 'matches schema' do
      expect(subject.to_json).to match_schema('entities/dag_pipeline')
    end
  end
end