summaryrefslogtreecommitdiff
path: root/spec/models/service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/service_spec.rb')
-rw-r--r--spec/models/service_spec.rb32
1 files changed, 14 insertions, 18 deletions
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index cb8122b6573..106f8def42d 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -87,6 +87,20 @@ describe Service do
end
end
+ describe '#operating?' do
+ it 'is false when the service is not active' do
+ expect(build(:service).operating?).to eq(false)
+ end
+
+ it 'is false when the service is not persisted' do
+ expect(build(:service, active: true).operating?).to eq(false)
+ end
+
+ it 'is true when the service is active and persisted' do
+ expect(create(:service, active: true).operating?).to eq(true)
+ end
+ end
+
describe '.confidential_note_hooks' do
it 'includes services where confidential_note_events is true' do
create(:service, active: true, confidential_note_events: true)
@@ -523,24 +537,6 @@ describe Service do
end
end
- describe "#deprecated?" do
- let(:project) { create(:project, :repository) }
-
- it 'returns false by default' do
- service = create(:service, project: project)
- expect(service.deprecated?).to be_falsy
- end
- end
-
- describe "#deprecation_message" do
- let(:project) { create(:project, :repository) }
-
- it 'is empty by default' do
- service = create(:service, project: project)
- expect(service.deprecation_message).to be_nil
- end
- end
-
describe '#api_field_names' do
let(:fake_service) do
Class.new(Service) do