Commit 3527cdd7ea882be49a60976b836fc12a7741bff4
1 parent
11182fce
Exists in
master
and in
1 other branch
Revert "update test to match newest code"
This reverts commit 792627d4051186317189397d128a69f051a05352.
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
spec/controllers/choices_controller_spec.rb
@@ -69,7 +69,9 @@ describe ChoicesController do | @@ -69,7 +69,9 @@ describe ChoicesController do | ||
69 | 69 | ||
70 | it "adds visitor_id params to flag if sent" do | 70 | it "adds visitor_id params to flag if sent" do |
71 | @visitor_identifier = "somelongunique32charstring" | 71 | @visitor_identifier = "somelongunique32charstring" |
72 | - Visitor.should_receive(:find_or_create_by_identifier_and_site_id).with(@visitor_identifier, @user.id).and_return(mock_visitor) | 72 | + visitor_list = [mock_visitor] |
73 | + @user.stub!(:visitors).and_return(visitor_list) | ||
74 | + visitor_list.should_receive(:find_or_create_by_identifier).with(@visitor_identifier).and_return(mock_visitor) | ||
73 | 75 | ||
74 | Flag.should_receive(:create!).with({:choice_id => 123, :question_id => 37, :site_id => @user.id, :explanation => "This is offensive", :visitor_id => mock_visitor.id}) | 76 | Flag.should_receive(:create!).with({:choice_id => 123, :question_id => 37, :site_id => @user.id, :explanation => "This is offensive", :visitor_id => mock_visitor.id}) |
75 | 77 |