Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-09 Thread David Chelimsky
On Jul 9, 2010, at 8:06 AM, David Chelimsky wrote: > On Jul 9, 2010, at 6:59 AM, garren wrote: >> >> >> On Jul 7, 12:34 pm, David Chelimsky wrote: >>> On Jul 7, 2010, at 5:26 AM, Trevor Lalish-Menagh wrote: >>> > Did you know about the rspec-dev meta project? >>> > http://github.com/r

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Phillip Koebbe
On 2010-07-09 8:38 AM, Wincent Colaiuta wrote: El 09/07/2010, a las 14:29, Frank J. Mattia escribió: it "should explicitly set created_by" do controller.stub(:current_user) { mock_user } mock_order.should_receive(:created_by=).with(mock_user) post :create end This is my newly working spe

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Frank J. Mattia
> >>> it "should explicitly set created_by" do > >>>  controller.stub(:current_user) { mock_user } > >>>  mock_order.should_receive(:created_by=).with(mock_user) > >>>  post :create > >>> end > > >>> This is my newly working spec. Does this look well thought out or is > >>> there some glaring pitfa

Re: [rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

2010-07-09 Thread Patrick Gannon
On Mon, Jul 5, 2010 at 1:26 PM, David Chelimsky wrote: > I just pushed what I believe to be a fix for this - please try pointing > Gemfile to the git repos again. It should work if you do this with all of > them: > > gem "rspec-rails",:git => "git://github.com/rspec/rspec-rails.git" > gem

[rspec-users] Devise: session variable is empty on session_serializer.rb#store

2010-07-09 Thread Daniel Salmeron Amselem
I've been trying to test a very simple action on a controller with this setup: rspec 1.3.0 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] Rails 2.3.8 devise 1.0.8 And this is the test: before :each do @member = Factory.create(:member) sign_in @member @person

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Wincent Colaiuta
El 09/07/2010, a las 14:29, Frank J. Mattia escribió: >>> it "should explicitly set created_by" do >>> controller.stub(:current_user) { mock_user } >>> mock_order.should_receive(:created_by=).with(mock_user) >>> post :create >>> end >> >>> This is my newly working spec. Does this look well tho

Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-09 Thread David Chelimsky
On Jul 9, 2010, at 6:59 AM, garren wrote: > > > On Jul 7, 12:34 pm, David Chelimsky wrote: >> On Jul 7, 2010, at 5:26 AM, Trevor Lalish-Menagh wrote: >> Did you know about the rspec-dev meta project? >> http://github.com/rspec/rspec-dev >> >>> That is great. I should have looked for

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Frank J. Mattia
> > > Seems reasonable to me. You could test with either an interaction based > > > approach (use mocks and stubs to confirm that @object receives the > > > "created_by" message with the expected param) or a state based approach > > > (hit the controller action and then inspect the system state aft

Re: [rspec-users] Setting up rspec-rails for hacking

2010-07-09 Thread garren
I've followed the instructions to install the dev environment, when I run rake install I get this for the rspec-rails: cp ./templates/Gemfile ./tmp/example_app/ rake rails:template LOCATION='../../templates/generate_stuff.rb' (in /Users/garren/webdev/rspec-dev/repos/rspec-rails/tmp/example_app)

Re: [rspec-users] Testing equality

2010-07-09 Thread Juanma Cervera
The updated_at has class ActiveSupport::TimeWithZone v.updated_at.should == f.updated_at fails v.updated_at.to_datetime.should == f.to_datetime.updated_at fails v.updated_at.to_s.should == f.updated_at.to_s works v.updated_at.to_i.should == f.updated_at.to_i works And adding this method to the m

Re: [rspec-users] Testing equality

2010-07-09 Thread Juanma Cervera
David Chelimsky wrote: > On Jul 8, 2010, at 5:04 AM, Juanma Cervera wrote: > >> end. >> >> FAILS >> >> This fails because the object expected is different from the object >> gotten, and the only difference are the BigDecimal attributes, that are >> different objects, even though they have the sa

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Wincent Colaiuta
El 09/07/2010, a las 04:25, Frank J. Mattia escribió: >> Seems reasonable to me. You could test with either an interaction based >> approach (use mocks and stubs to confirm that @object receives the >> "created_by" message with the expected param) or a state based approach (hit >> the controlle