Sha256: da5da649041cc6b03f711a9ed6b0db121d005a8301c2c1ed9024f3cc2fbd9eb1

Contents?: true

Size: 849 Bytes

Versions: 4

Compression:

Stored size: 849 Bytes

Contents

require 'spec_helper'

describe SimpleNavigation::Adapters::Padrino do

  def create_adapter
    SimpleNavigation::Adapters::Padrino.new(@context)
  end
  
  before(:each) do
    @request = stub(:request)
    @content = stub(:content)
    @context = stub(:context, :request => @request)
    @adapter = create_adapter
  end
  
  describe 'link_to' do
    it "should delegate to context" do
      @context.should_receive(:link_to).with('name', 'url', :my_option => true)
      @adapter.link_to('name', 'url', :my_option => true)
    end
  end
  
  describe 'content_tag' do
    it "should delegate to context" do
      @content.should_receive(:html_safe).and_return('content')
      @context.should_receive(:content_tag).with('type', 'content', :my_option => true)
      @adapter.content_tag('type', @content, :my_option => true)
    end
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
jordanyeo-simple-navigation-3.11.1 spec/lib/simple_navigation/adapters/padrino_spec.rb
jordanyeo-simple-navigation-3.11.0 spec/lib/simple_navigation/adapters/padrino_spec.rb
simple-navigation-3.11.0 spec/lib/simple_navigation/adapters/padrino_spec.rb
simple-navigation-3.10.1 spec/lib/simple_navigation/adapters/padrino_spec.rb