Commit 64a0f42e20fca45db2129bd5f5027e9aa1bdf785

Authored by Dhruv Kapadia
1 parent 1be015eb

Fixing failing tests that no longer apply

spec/factories.rb
... ... @@ -22,6 +22,17 @@ Factory.define(:aoi_question, :parent => :question) do |f|
22 22 end
23 23 result
24 24 end
  25 + f.prompts do |question|
  26 + result = []
  27 + 1.times do
  28 + result << Factory.build(:prompt,
  29 + :question => question.result,
  30 + :left_choice => question.choices.first,
  31 + :right_choice => question.choices.second)
  32 +
  33 + end
  34 + result
  35 + end
25 36 end
26 37  
27 38 Factory.define(:visitor) do |f|
... ...
spec/models/choice_spec.rb
... ... @@ -25,12 +25,12 @@ describe Choice do
25 25 Choice.create!(@valid_attributes)
26 26 end
27 27  
28   - it "should generate prompts after two choices are created" do
29   - proc {
30   - choice1 = Choice.create!(@valid_attributes.merge(:data => '1234'))
31   - choice2 = Choice.create!(@valid_attributes.merge(:data => '1234'))
32   - }.should change(@question.prompts, :count).by(2)
33   - end
  28 + #it "should generate prompts after two choices are created" do
  29 + # proc {
  30 +# choice1 = Choice.create!(@valid_attributes.merge(:data => '1234'))
  31 +# choice2 = Choice.create!(@valid_attributes.merge(:data => '1234'))
  32 +# }.should change(@question.prompts, :count).by(2)
  33 +# end
34 34  
35 35 it "should deactivate a choice" do
36 36 choice1 = Choice.create!(@valid_attributes.merge(:data => '1234'))
... ...
spec/models/question_spec.rb
... ... @@ -33,9 +33,9 @@ describe Question do
33 33 q.choices(true).size.should == 0
34 34 end
35 35  
36   - it "should generate prompts after choices are added" do
37   - @question.prompts(true).size.should == 2
38   - end
  36 + #it "should generate prompts after choices are added" do
  37 + #@question.prompts(true).size.should == 2
  38 + #end
39 39  
40 40 it "should choose an active prompt randomly" do
41 41 prompt = @question.picked_prompt
... ... @@ -127,9 +127,6 @@ describe Question do
127 127 # Sanity check
128 128 @catchup_q.choices.size.should == 100
129 129  
130   - #the catchup algorithm depends on all prompts being generated automatically
131   - @catchup_q.prompts.size.should == 100 **2 - 100
132   -
133 130 prompt = @catchup_q.catchup_choose_prompt
134 131 prompt.active?.should == true
135 132 end
... ...