Sha256: feb82aaef151562163785acf313956bd9fdfcdc6b703c90084c8c3ccd83b38af

Contents?: true

Size: 869 Bytes

Versions: 4

Compression:

Stored size: 869 Bytes

Contents

require 'spec_helper'

describe Kashiwamochi::ActionView do
  describe '#search_form_for' do
    before do
      @q = Kashiwamochi::Query.new(:name => 'test', :s => ['name desc'])
      helper.search_form_for @q, :url => {:controller => 'users', :action => 'index'} do |f|
        @f = f
      end
    end
    subject { @f }

    it { should be_an_instance_of ActionView::Helpers::FormBuilder }
  end

  describe '#search_sort_link_to' do
    before do
      @q = Kashiwamochi::Query.new(:name => 'test', :s => ['name desc'])
      @link = helper.search_sort_link_to(@q, :name, 'User name', :controller => 'users', :action => 'index')
    end
    subject { @link }

    it { should match %r(href="/users\?q%5Bname%5D=test&q%5Bs%5D%5B%5D=name\+asc") }
    it { should match %r(class="name_sort_link sort_link desc") }
    it { should match %r(User name) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kashiwamochi-0.2.3 spec/helpers/action_view_spec.rb
kashiwamochi-0.2.2 spec/helpers/action_view_spec.rb
kashiwamochi-0.2.1 spec/helpers/action_view_spec.rb
kashiwamochi-0.2.0 spec/helpers/action_view_spec.rb