Sha256: a35c8594725acacb18cfb8065082d0bc2536b82a95281fce5224c5f912a71644
Contents?: true
Size: 796 Bytes
Versions: 33
Compression:
Stored size: 796 Bytes
Contents
require 'spec_helper' describe SavedSearchesController do before(:all) do @one = Search.create @two = Search.create @three = Search.create end before(:each) do @user = User.create! :email => 'test@example.com', :password => 'abcd12345', :password_confirmation => 'abcd12345' sign_in @user end describe "save" do it "should let you save a search" do request.env["HTTP_REFERER"] = "where_i_came_from" session[:history] = [@one.id] post :save, :id => @one.id expect(response).to redirect_to "where_i_came_from" end it "should not let you save a search that isn't in your search history" do session[:history] = [@one.id] expect { post :save, :id => @two.id }.to raise_exception end end end
Version data entries
33 entries across 33 versions & 1 rubygems