Sha256: 2c921a75de9b14586b3cc8c0b7c7a6572c1de1775a8a377ff3e1be4cca14f7f5

Contents?: true

Size: 763 Bytes

Versions: 9

Compression:

Stored size: 763 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
        template.should_not_receive(:url_for)
        scope.should_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
        template.should_receive(:url_for)
        scope.should_not_receive(:url_for)
        subject.page_url_for(1)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.3 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.2 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.1 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.0 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.0.rc8 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.0.rc7 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.0.rc6 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb
alchemy_cms-3.0.0.rc5 spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb