2016-11-04 08:23:06 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-04-20 06:21:24 -04:00
|
|
|
describe DeploymentEntity do
|
2017-03-06 13:22:23 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:request) { double('request') }
|
2017-04-20 06:21:24 -04:00
|
|
|
let(:deployment) { create(:deployment) }
|
|
|
|
let(:entity) { described_class.new(deployment, request: request) }
|
|
|
|
subject { entity.as_json }
|
2017-03-06 13:22:23 -05:00
|
|
|
|
|
|
|
before do
|
2017-05-09 00:15:34 -04:00
|
|
|
allow(request).to receive(:current_user).and_return(user)
|
2017-03-06 13:22:23 -05:00
|
|
|
end
|
2017-03-11 12:22:08 -05:00
|
|
|
|
2016-11-04 08:23:06 -04:00
|
|
|
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
|
2017-03-28 06:48:53 -04:00
|
|
|
|
|
|
|
it 'exposes creation date' do
|
|
|
|
expect(subject).to include(:created_at)
|
|
|
|
end
|
2016-11-04 08:23:06 -04:00
|
|
|
end
|