[rspec-users] spec for view with Searchlogic

Andrea Jahn anja-email1 at web.de
Wed Mar 25 10:32:50 EDT 2009



 

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 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090325/91e374a6/attachment.html>


More information about the rspec-users mailing list