aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_track_controller_spec.rb
blob: b77570a2718fb51ee83c555bb880616ba83a3191 (plain)
1
2
3
4
5
6
7
8
9
# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe AdminTrackController, "when administering tracks" do

    it "shows the index page" do
        get :index
    end
end
, 0.01 ci[1].should be <= 1 end end describe "when passed all failures" do it "should never return a low CI below 0" do ci = ci_bounds 0, 10, 0.05 ci[0].should be >= 0 end end describe "when passed 4 out of 10 successes (with 0.05 power)" do it "should return the correct Wilson's interval" do # The expected results here were taken from an online # calculator: # http://www.vassarstats.net/prop1.html ci = ci_bounds 7, 10, 0.05 ci[0].should be_within(0.001).of(0.3968) ci[1].should be_within(0.001).of(0.8922) end end end