Sha256: 2ab83484310f82a48f9d51e262f3e6fad209d9c9f874330bdc592450ce03859f

Contents?: true

Size: 1.62 KB

Versions: 1

Compression:

Stored size: 1.62 KB

Contents

require 'spec_helper'

describe InstitutionsController do

  render_views

  describe "GET 'index'" do

    it "should show the institutions page" do
      get :index
      expect(response).to be_success
      expect(response.body).to have_selector("div.blacklight-institution")
      expect(assigns(:document_list)).not_to be_nil
    end

    describe "remove_unwanted_views" do

      it "should not show the gallery, masonry, or slideshow views" do
        get :index
        expect(response.body).to_not have_selector(".view-type-gallery")
        expect(response.body).to_not have_selector(".view-type-masonry")
        expect(response.body).to_not have_selector(".view-type-slideshow")
      end

    end

    describe "map view" do

      it "should show the map on institutions page" do
        get :index, :view => 'maps'
        expect(response.body).to have_selector("#institutions-index-map")
      end

    end

  end

  describe "GET 'show'" do

    before(:each) do
      @institution_id = 'bpl-dev:abcd12345'
    end

    it "should show the institution page" do
      get :show, :id => @institution_id
      expect(response).to be_success
      expect(response.body).to have_selector("div.blacklight-institution")
      expect(assigns(:document)).not_to be_nil
    end

    it "should show some facets" do
      get :show, :id => @institution_id
      expect(response.body).to have_selector("#facets")
    end

    it "should show a list of collections" do
      get :show, :id => @institution_id
      expect(response.body).to have_selector("#institution_collections")
      expect(assigns(:document_list)).not_to be_nil
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commonwealth-vlr-engine-0.0.1 spec/controllers/institutions_controller_spec.rb