Spec for view with Searchlogic


#1

Hi,

I’m using the Searchlogic plugin. Since I have added the search form in
the index template,
the view spec doesn’t work anymore.

Controller

def index
@search = PlPlanning.new_search(params[:search])
@search.order_by = :id
@pl_plannings, @count = @search.all, @search.count
end

view

<% remote_form_for [:planning, @search] do |f| %> Search <%= PlPlanning::DISPLAY_NAME.pluralize %> <% f.fields_for @search.conditions do |pl_plannings| %> <%= pl_plannings.label :id, PlPlanning::DISPLAY_NAME + " Id:", :class => "search_label" %> <%= pl_plannings.text_field :id %>
<%= f.submit "Search" %> <% end %> <% end %>

spec

class Searchlogic::Cache::PlPlanningSearch; end

before(:each) do
@pl_plannings = []
assigns[:pl_plannings] = @pl_plannings

@search = Searchlogic::Cache::PlPlanningSearch.new ???
assigns[:search] = @search

render “/planning/pl_plannings/index”
end

=> Error in the line containing the remote_form_for call
undefined method `planning_searchlogic_cache_pl_planning_search_path’
for #ActionView::Base:0x6b6bf38

Has anybody experience with Searchlogic + rspec ? Can I stub
search_paths ?

Thanks
Andrea

Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und
viele
ausländische Netze zum gleichen Preis!