Sha256: f01afa15e028f70036dc21c61b03322474acad33c2616b5ec99e5f03359e9de3
Contents?: true
Size: 1.1 KB
Versions: 29
Compression:
Stored size: 1.1 KB
Contents
# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe SearchHistoryController do include Devise::TestHelpers describe "index" do before(:all) do @one = Search.create @two = Search.create @three = Search.create end it "should only fetch searches with ids in the session" do session[:history] = [@one.id, @three.id] get :index @searches = assigns(:searches) @searches.length.should == 2 @searches.should include(@one) @searches.should include(@three) @searches.should_not include(@two) end it "should tolerate bad ids in session" do session[:history] = [@one.id, @three.id, "NOT_IN_DB"] get :index @searches = assigns(:searches) @searches.length.should == 2 @searches.should include(@one) @searches.should include(@three) end it "should not fetch any searches if there is no history" do session[:history] = [] get :index @searches = assigns(:searches) @searches.length.should == 0 end end end
Version data entries
29 entries across 29 versions & 1 rubygems