spec/dashboard_spec.rb in split-0.7.1 vs spec/dashboard_spec.rb in split-0.7.2

- old
+ new

@@ -19,10 +19,14 @@ let(:experiment_with_goals) { Split::Experiment.find_or_create({"link_color" => ["goal_1", "goal_2"]}, "blue", "red") } + let(:metric) { + Split::Metric.find_or_create(name: 'testmetric', experiments: [experiment, experiment_with_goals]) + } + let(:red_link) { link("red") } let(:blue_link) { link("blue") } it "should respond to /" do get '/' @@ -41,9 +45,18 @@ last_response.body.should include('Start') post "/start/#{experiment.name}" get '/' last_response.body.should include('Reset Data') + last_response.body.should_not include('Metrics:') + end + end + + context "experiment with metrics" do + it "should display the names of associated metrics" do + metric + get '/' + last_response.body.should include('Metrics:testmetric') end end context "with goals" do it "should display a Start button" do