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
-----

<!-- search form -->
<div id='search_form_area' class="search_form" style="display:none" >
 <% remote_form_for [:planning, @search] do |f| %>
 <fieldset>
 <legend>Search <%= PlPlanning::DISPLAY_NAME.pluralize %></legend>
 <% f.fields_for @search.conditions do |pl_plannings| %> 
 <%= pl_plannings.label :id, PlPlanning::DISPLAY_NAME + " Id:", :class => 
"search_label" %>
 <%= pl_plannings.text_field :id %>
 <br />
 <%= f.submit "Search" %>
 <% end %>
 </fieldset> 
 <% end %>
</div>


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! 
https://produkte.web.de/webde_sms/sms 
 

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to