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

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

describe BuildActionEntity do
  let(:build) { create(:ci_build, name: 'test_build') }

  let(:entity) do
    described_class.new(build, request: double)
  end

  describe '#as_json' do
    subject { entity.as_json }

    it 'contains humanized build name' do
      expect(subject[:name]).to eq 'Test build'
    end

    it 'contains path to the action play' do
      expect(subject[:path]).to include "builds/#{build.id}/play"
    end
  end
end