Sha256: c98db052003c9a33d26b63322812df0b16e4f410a2d644c19cf5988d7ee5c9a9
Contents?: true
Size: 1.03 KB
Versions: 45
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe SearchHistoryController do 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) expect(@searches).to have(2).searches expect(@searches).to include(@one) expect(@searches).to include(@three) expect(@searches).to_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) expect(@searches).to have(2).searches expect(@searches).to include(@one) expect(@searches).to include(@three) end it "should not fetch any searches if there is no history" do session[:history] = [] get :index @searches = assigns(:searches) expect(@searches).to be_empty end end end
Version data entries
45 entries across 45 versions & 1 rubygems