gitlab-org--gitlab-foss/spec/serializers/deployment_entity_spec.rb
2017-05-09 04:15:34 +00:00

25 lines
621 B
Ruby

require 'spec_helper'
describe DeploymentEntity do
let(:user) { create(:user) }
let(:request) { double('request') }
let(:deployment) { create(:deployment) }
let(:entity) { described_class.new(deployment, request: request) }
subject { entity.as_json }
before do
allow(request).to receive(:current_user).and_return(user)
end
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
it 'exposes creation date' do
expect(subject).to include(:created_at)
end
end