search for: hash_including

Displaying 6 results from an estimated 6 matches for "hash_including".

2008 Aug 06
3
hash_excluding/hash_only?
I know there is a hash_including, which is quite useful. Are there by chance any matchers for ensuring a hash includes only the specified values, or that it doesn''t have certain values? Thanks, Steve
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY out the repeated parts of my forms and put them in common/form and render the form elements via another partial in controller_name/_form. Here''s the first form # app/views/common/form <% form_for ... do |f| -%> <%= render :partial => "params[:controller]/form", :object => f
2008 May 26
2
RSpec-1.1.4
The RSpec Development Team is happy to announce the release of RSpec-1.1.4. See http://rspec.info/changes.html for details of what changed in this release. For Rails developers: * This release of RSpec supports Rails-2.1.0-RC1, 2.0.2, 1.2.6 More info at http://rspec.info. Cheers, David
2008 May 23
4
Is there an equivalent to anything() for Hash parameters?
Hi -- is there an equivalent to the anything() method to use with Hash parameters? So that the following call: Model.find( :all, :conditions => "name LIKE ''%rt%''", :order => ''name'' ) Could have the two following successful examples: Model.should_receive( :find ).with( :all, { :conditions => "name LIKE ''%rt%", anything }
2008 Mar 05
14
ActiveRecord, spec''ing find has right :order parameter
I''m wanting to write a spec that a model is applying an :order option to a find call, but I don''t want to completely specify all of the find parameters. So I want to write something like this, say in a controller spec User.should_receive(:find).with(:all, hash_with_at_least(:order => ''user.name ASC'')) get ''index'', :sort =>
2010 Jun 20
10
RSpec 2 view example: render_template
On http://github.com/rspec/rspec-rails under "View specs" there''s an example describe "events/index.html.erb" do it "renders _event partial for each event" do assign(:events, [stub_model(Event), stub_model(Event)]) render view.should render_template(:partial => "_event", :count => 2) end end Is this indeed correct? From the