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

Version Path
blacklight-5.15.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.14.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.13.1 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.13.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.11.3 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.12.1 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.12.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.10.3 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.9.4 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.11.2 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.11.1 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.11.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.10.2 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.10.1 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.10.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.9.3 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.9.2 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.9.1 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.9.0 spec/controllers/saved_searches_controller_spec.rb
blacklight-5.8.2 spec/controllers/saved_searches_controller_spec.rb