diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2017-03-31 12:20:11 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-03-31 12:20:11 +0300 |
commit | 9a0f96f9adaf38ae45a1f7b147c196aa12ba451f (patch) | |
tree | 0c55f474ed8500789efb655396b98974ece180e9 /spec/serializers/environment_entity_spec.rb | |
parent | 75fe1277c6291202416255a410e85b6dc742dda8 (diff) |
Add metrics button to Environment Overview page
Diffstat (limited to 'spec/serializers/environment_entity_spec.rb')
-rw-r--r-- | spec/serializers/environment_entity_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/serializers/environment_entity_spec.rb b/spec/serializers/environment_entity_spec.rb index 57728ce3181..979d9921941 100644 --- a/spec/serializers/environment_entity_spec.rb +++ b/spec/serializers/environment_entity_spec.rb @@ -15,4 +15,24 @@ describe EnvironmentEntity do it 'exposes core elements of environment' do expect(subject).to include(:id, :name, :state, :environment_path) end + + context 'metrics disabled' do + before do + allow(environment).to receive(:has_metrics?).and_return(false) + end + + it "doesn't expose metrics path" do + expect(subject).not_to include(:metrics_path) + end + end + + context 'metrics enabled' do + before do + allow(environment).to receive(:has_metrics?).and_return(true) + end + + it 'exposes metrics path' do + expect(subject).to include(:metrics_path) + end + end end |