# spec/controllers/catalog_controller_spec.rb
require 'spec_helper'

describe CatalogController do

  describe "show" do
    it "should support using the login=true url parameter to force redirect to login page" do
      get :show, { id: "test:123", login: "true" }
      expect(response).to be_redirect 
      expect(response).to redirect_to(user_session_path)
    end
  end

  describe "index" do
    it "should support using the login=true url parameter to force redirect to login page" do
      get :index, {q: "Test", commit:"Search", login: "true" }
      expect(response).to be_redirect 
      expect(response).to redirect_to(user_session_path)
    end
  end

end