Sha256: dc39152ad2df148c40162cbe3cb6b09864d642a2321c499aa4b45d9bf894a5fc

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe BatchEditsHelper, :type => :helper do

  describe "#render_check_all" do

    before do
      @document_list = ["doc1", "doc2"]
      @batch_size_on_other_page = 1
      @max_batch_size = 10
    end

    context "with my files" do
      it "should show the check all dropdown" do
        allow(helper).to receive(:params).and_return({ controller: "my/files" })
        allow(helper).to receive(:controller_name).and_return("batch_edits")
        expect(helper.render_check_all).to have_css("span.glyphicon-cog")
      end
    end

    context "with my collections" do
      it "should not show the check all dropdown" do
        allow(helper).to receive(:params).and_return({ controller: "my/collections" })
        expect(helper.render_check_all).to be_nil
      end
    end

    context "with select all disabled" do
      it "should not show the check all dropdown" do
        allow(helper).to receive(:params).and_return({ controller: "foo" })
        assign(:disable_select_all, true)
        expect(helper.render_check_all).to be_nil
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sufia-4.2.0 spec/helpers/batch_edits_helper_spec.rb
sufia-4.1.0 spec/helpers/batch_edits_helper_spec.rb