Sha256: bd7162840ff7b22c1363b39395771ccdc3f70aa24dbe971218cf92ca59862ab3

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'

describe "spotlight/tags/index.html.erb" do
  let(:exhibit) { Spotlight::Exhibit.default }
  let!(:tag1) { FactoryGirl.create(:tagging) }
  let!(:tag2) { FactoryGirl.create(:tagging) }
  before do
    assign(:exhibit, exhibit)
    assign(:tags, exhibit.owned_tags)
    view.stub(exhibit_tag_path: "/tags")
    view.stub(:current_exhibit).and_return(exhibit)
    view.stub(:url_to_tag_facet) { |*args| args.first }
  end
  describe "Tags" do
    it "should be displayed" do
      render
      [tag1.tag.name, tag2.tag.name].each do |name|
        expect(rendered).to have_css("td", text: name)
      end
    end
  end
  describe "Total tags" do
    it "should be displayed" do
      render
      expect(rendered).to have_css("span.label.label-default", text: 2)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.0.3 spec/views/spotlight/tags/index.html.erb_spec.rb