BigW Consortium Gitlab

deployment_entity_spec.rb 613 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe DeploymentEntity do
4 5
  let(:user) { create(:user) }
  let(:request) { double('request') }
6 7 8
  let(:deployment) { create(:deployment) }
  let(:entity) { described_class.new(deployment, request: request) }
  subject { entity.as_json }
9 10 11 12

  before do
    allow(request).to receive(:user).and_return(user)
  end
13

14 15 16 17 18 19 20
  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'
  end
21 22 23 24

  it 'exposes creation date' do
    expect(subject).to include(:created_at)
  end
25
end