Forum: RSpec spec for view with Searchlogic

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrea J. (Guest)
on 2009-03-25 16:50
(Received via mailing list)
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
This topic is locked and can not be replied to.