Commit e81a0337 authored by Arturo Herrero's avatar Arturo Herrero

Improve spec descriptions

parent 6e81b31c
...@@ -280,11 +280,13 @@ describe Service do ...@@ -280,11 +280,13 @@ describe Service do
describe '.build_from_integration' do describe '.build_from_integration' do
context 'when integration is invalid' do context 'when integration is invalid' do
it 'sets service to inactive when integration is invalid' do let(:integration) do
template = build(:prometheus_service, template: true, active: true, properties: {}) build(:prometheus_service, :template, active: true, properties: {})
template.save(validate: false) .tap { |integration| integration.save(validate: false) }
end
service = described_class.build_from_integration(project.id, template) it 'sets service to inactive' do
service = described_class.build_from_integration(project.id, integration)
expect(service).to be_valid expect(service).to be_valid
expect(service.active).to be false expect(service.active).to be false
...@@ -292,9 +294,9 @@ describe Service do ...@@ -292,9 +294,9 @@ describe Service do
end end
context 'when integration is an instance' do context 'when integration is an instance' do
subject(:integration) { create(:jira_service, :instance) } let(:integration) { create(:jira_service, :instance) }
it 'sets service inherit from integration' do it 'sets inherit_from_id from integration' do
service = described_class.build_from_integration(project.id, integration) service = described_class.build_from_integration(project.id, integration)
expect(service.inherit_from_id).to eq(integration.id) expect(service.inherit_from_id).to eq(integration.id)
......
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