Sha256: 6a56b89cb7b1e20fd9da4e8cae25529d05616d151a60a3e1493b3562bbbf8931

Contents?: true

Size: 779 Bytes

Versions: 19

Compression:

Stored size: 779 Bytes

Contents

require 'spec_helper'

describe Kaminari::Helpers::Tag do
  subject { Kaminari::Helpers::Tag.new(template, options) }

  let(:template) { double(params: {}) }
  let(:scope)    { double(url_for: '') }

  describe '#page_url_for' do
    context "with scope option given" do
      let(:options) { {scope: scope} }

      it "calls url_for on that url proxy scope." do
        expect(template).not_to receive(:url_for)
        expect(scope).to receive(:url_for)
        subject.page_url_for(1)
      end
    end

    context "with no scope option given" do
      let(:options) { {} }

      it "calls url_for on the template." do
        expect(template).to receive(:url_for)
        expect(scope).not_to receive(:url_for)
        subject.page_url_for(1)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
alchemy_cms-3.3.0.rc1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.2.1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.3 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
lc_alchemy_cms-3.2.1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
lc_alchemy_cms-3.2.0 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.2.0 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.2.0.rc1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.2.0.beta spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.rc3 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.rc2 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.rc1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta6 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta5 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta4 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta3 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta2 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.1.0.beta1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb