summaryrefslogtreecommitdiff
path: root/spec/serializers/deployment_entity_spec.rb
blob: ea87771e2a2b11b05457271169c7b71f2cda279e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe DeploymentEntity do
  let(:entity) do
    described_class.new(deployment, request: double)
  end

  let(:deployment) { create(:deployment) }

  subject { entity.as_json }

  it 'exposes internal deployment id'  do
    expect(subject).to include(:iid)
  end

  it 'exposes nested information about branch' do
    expect(subject[:ref][:name]).to eq 'master'
    expect(subject[:ref][:ref_path]).not_to be_empty
  end
end