Displaying 5 results from an estimated 5 matches for "activerain".
2007 Apr 20
7
Stubbing Model.new w/ block?
...t to the return value of the block.
I also tried something along the lines of:
Receipt.stub!(:new) do
yield @receipt
@receipt
end
but got some weird no block error.
Help? Am I going about this all wrong?
-james
--
James A. Hillyerd <james at hillyerd.com>
Chief Technical Officer - ActiveRain Corp
2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
Hello! I''m pretty new to unit testing, and have only been using RSpec
for a few weeks. I found that for my controller specs, my setup
methods were getting very long building mocks/stubs for all the model
objects I needed to work with.
I''ve started creating helpers like the following for each of my
models. The "min_" methods are short for "minimum", and
2006 Sep 27
2
Seg Fault - crashed our server
...506:in
`close''
We were just doing basic stuff like:
acts_as_ferret :fields => {
:title => {:boost => 2},
:description => {:boost => 1.5}
Model.find_by_contents("find stuff")
On tables that had maybe 10,000+ rows
Anyone have any ideas?
-ben
http://activerain.com
--
Posted via http://www.ruby-forum.com/.
2008 Jan 01
26
Did DHH have a suit on?
So I''m wondering about the origin of "ActiveRecord" and "ActionPack" and
the like in Rails.
I''ve always thought that perhaps DHH found himself in a suit one day
(maybe he had to attend a friend''s wedding or something), and as long as
he had the suit on, decided to lapse into a one of the barely lucid
frenzies that Marketing people are prone to when
2007 Apr 30
4
Mocking with Calculated Results
I am setting up an AR mock object and wanted to sanity check it. My
intent is to mix this into all my examples and then override/add
methods where necessary. Note that I''ve anticipated three cases for
find:
find with one numeric argument => object
find with :all => Array
find with anything else => nil
This roughly approximates how ActiveRecord::find works in this case