spec/metric/track_spec.rb in metric-0.0.8 vs spec/metric/track_spec.rb in metric-0.0.9
- old
+ new
@@ -9,9 +9,16 @@
Metric::Track.should_receive(:quit_early?).and_return(false)
Metric::Track.should_receive(:compose).with("hits", {})
Metric::Track.track("hits")
end
+ it "uses http when ssl is false" do
+ Metric.configure do |config|
+ config.ssl = false
+ end
+ Metric::Track.compose("hits").should == "http://api.metric.io/track?api_key=spec&metric=hits"
+ end
+
it "encodes the input" do
url = "https://api.metric.io/track?api_key=spec&metric=hits+and+spaces"
Metric::Track.compose("hits and spaces").should == url
end