Commit e49fb264 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add tests for deployment and environment entitites

parent 3968b07d
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_url]).not_to be_empty
end
end
require 'spec_helper'
describe EnvironmentEntity do
let(:entity) do
described_class.new(environment, request: double)
end
let(:environment) { create(:environment) }
subject { entity.as_json }
it 'exposes latest deployment' do
expect(subject).to include(:last_deployment)
end
it 'exposes core elements of environment' do
expect(subject).to include(:id, :name, :state, :environment_url)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment