Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-04 Thread Martin Hawkins
I can't believe I did that either... Doh! On Dec 4, 4:04 pm, David Chelimsky wrote: > On Sat, Dec 4, 2010 at 8:34 AM, Martin Hawkins > wrote: > > I can't believe I did that... > > No, there is only one Factory; copy and paste error. The SeasonDate > > class is: > > class SeasonDate < ActiveReco

Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-04 Thread David Chelimsky
On Sat, Dec 4, 2010 at 8:34 AM, Martin Hawkins wrote: > I can't believe I did that... > No, there is only one Factory; copy and paste error. The SeasonDate > class is: > class SeasonDate < ActiveRecord::Base >  def self.find_start_record >    where(["date_type = ?", "start_date"]).first I think t

Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-04 Thread Martin Hawkins
Apologies if this is a repeat post but google seemed to ignore my last effort. There is only one Factory - copy, paste and editing error. I can't believe that I didn't include the code being tested... class SeasonDate < ActiveRecord::Base def self.find_start_record where(["date_type = ?", "s

Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-04 Thread Martin Hawkins
I can't believe I did that... No, there is only one Factory; copy and paste error. The SeasonDate class is: class SeasonDate < ActiveRecord::Base def self.find_start_record where(["date_type = ?", "start_date"]).first end end Agreed regarding the redundant test - I just put that in when thi

Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-03 Thread David Chelimsky
On Dec 3, 2010, at 11:07 AM, Martin Hawkins wrote: > Ruby 1.9.2, Rails 3.0.3, Rspec-rails 2.2.0 > > I have: > > Factory.define :season_date do |f| > f.season_date Date.new(2011,9,24) > f.date_type "season_start" > end > > RSpec.configure do |config| > config.mock_with :rspec > end > > Facto

[rspec-users] Speccing a model class method in Rails produces nil

2010-12-03 Thread Martin Hawkins
Ruby 1.9.2, Rails 3.0.3, Rspec-rails 2.2.0 I have: Factory.define :season_date do |f| f.season_date Date.new(2011,9,24) f.date_type "season_start" end RSpec.configure do |config| config.mock_with :rspec end Factory.define :season_date do |f| f.season_date Date.new(2011,9,24) f.date_ty