spec/lib/xcal/parktronic/routes/metrics_routes_spec.rb in xcal-parktronic-1.0.0 vs spec/lib/xcal/parktronic/routes/metrics_routes_spec.rb in xcal-parktronic-1.0.1
- old
+ new
@@ -28,10 +28,17 @@
metric = nil
expect{ metric = api_http_client.get_metric(2) }.not_to raise_error
expect(metric.id.to_s).to eql('7')
end
+
+ it 'should find metric by name' do
+ metric = nil
+ expect { metric = api_http_client.get_metric_by_name('Metric Name') }.not_to raise_error
+
+ expect(metric.id.to_s).to eql('7')
+ end
end
context 'posting' do
let(:metric) do
{ :name => 'metric name', :originating_system => 'Source System', :impact_level => 'low', :tag_list => %w(taga tagb) }
@@ -87,6 +94,6 @@
expect(metric.get_device_errors.last.value).to eql(32)
end
end
end
-end
\ No newline at end of file
+end