Re: [rspec-users] Understanding routing specs that use constraints

2010-10-28 Thread David Chelimsky
On Oct 27, 2010, at 2:49 PM, Joseph DelCioppio wrote: > Hello all, > > I'm trying to perform a pretty simple routing constraint > > Here are my routes, my constraint, and my spec. http://gist.github.com/649430 > > As you can see, I've attempted to stub my RootConstraints.matches? > method to ju

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread David Chelimsky
On Oct 28, 2010, at 3:25 PM, Mack T. wrote: > Figured this out. Our fixtures outside Rspec are actually being used to > create instances of ActiveRecord models. AR supports > accepts_nested_attributes_for, but the Rspec fixtures bypass AR and > simply attempt to set database values. There are n

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread Mack T.
Figured this out. Our fixtures outside Rspec are actually being used to create instances of ActiveRecord models. AR supports accepts_nested_attributes_for, but the Rspec fixtures bypass AR and simply attempt to set database values. -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] how to mock url_for ?

2010-10-28 Thread David Chelimsky
On Oct 27, 2010, at 12:40 PM, Eugen Ciur wrote: > Hi, > > I am testing a model A, which calls inside url_for method; rspec > complains that url_for is undefined Sometimes error messages tell you exactly what you need to know. In this case, url_is not defined in ActiveRecord models. This is true

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread David Chelimsky
On Wed, Oct 27, 2010 at 6:30 PM, Mack T. wrote: > I appreciate the quick response!  Sorry for the delay.  The relevant > code is attached.  Our model's name is Scale, which has_many > ScaleElements. > > We're loading fixtures in specs with config.fixture_path = > "#{::Rails.root}/spec/fixtures" >

[rspec-users] Understanding routing specs that use constraints

2010-10-28 Thread Joseph DelCioppio
Hello all, I'm trying to perform a pretty simple routing constraint Here are my routes, my constraint, and my spec. http://gist.github.com/649430 As you can see, I've attempted to stub my RootConstraints.matches? method to just return true or false. However, this doesn't seem to work correctly.

[rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-10-28 Thread Alexey Ilyichev
I have made 2 examples for this and I can't figure out how to make both pass. Take a look please: require 'spec_helper' describe "Mock" do class A def self.method_missing(name, *args, &block) '*a_method_missing*' end def self.present_method(arg) '*present_method*' e

[rspec-users] Autotest+RSpec2+Win32console = no color

2010-10-28 Thread Ar Vicco
I have the same problem with the combination above with Ruby 1.9.2 on Windows XP, as described here: http://www.ruby-forum.com/topic/205569 Calling Rspec directly produces colored output, but autotest spits out ANSI sequences. The issue was supposed to be closed with win32console 1.3.0, but obviou

[rspec-users] Issue with AR::Base descendants with certain argument

2010-10-28 Thread Alexey Ilyichev
Hi! I am trying to upgrade rspec-rails to 1.3.3, and one of my specs fails. In before :each I stub finder method like this: Payment.stub!(:find_by_id).with(@payment.id.to_s).and_return @payment Payment class is derived from AR::Base And then in one of the examples I call Payment.find_by_id((@pay