Re: [rspec-users] Testing with activerecord at ThoughtWorks (Stubbing vs real DB)

2009-06-27 Thread Ben Mabey
oren wrote: I am reading the post by Fowler, 'Ruby at ThoughtWorks'. http://martinfowler.com/articl/rubyAtThoughtWorks.html#WasRubyTheRightChoice He talks about testing with activerecord: "Right at the beginning of our use of Ruby, there was a debate on how best to organize testing in the prese

[rspec-users] Testing with activerecord at ThoughtWorks (Stubbing vs real DB)

2009-06-27 Thread oren
I am reading the post by Fowler, 'Ruby at ThoughtWorks'. http://martinfowler.com/articl/rubyAtThoughtWorks.html#WasRubyTheRightChoice He talks about testing with activerecord: "Right at the beginning of our use of Ruby, there was a debate on how best to organize testing in the presence of the Act

Re: [rspec-users] The problem with learning RSpec

2009-06-27 Thread oren
Thank you so much Stephen. I am ruby and rails beginner (created a simple site so far) that decided to dive into rspec and I feel the pains you described. I decided to start new rails app and do it with rspec (and to only test my models). Is there a github project with rspec code that test the m

Re: [rspec-users] The problem with learning RSpec

2009-06-27 Thread oren
Thank you so much Stephen. I am ruby and rails beginner (created a simple site so far) that decided to dive into rspec and I feel the pains you described. I decided to start new rails app and do it with rspec (and to only test my models). is there a github project with rspec code that test the mo

Re: [rspec-users] The problem with learning RSpec

2009-06-27 Thread oren
Thank you so much Stephen. I am ruby and rails beginner (created a simple site so far) that decided to dive into rspec and I feel the pains you described. I decided to start new rails app and do it with rspec (and to only test my models). Is there a github project with rspec code that test the m

Re: [rspec-users] The problem with learning RSpec

2009-06-27 Thread oren
test On Jun 12, 9:41 am, Stephen Eley wrote: > Ben and Rick, > > Thanks very much to both of you for the encouraging responses.  Your > reply, Ben, came just in time as I was starting to wonder if I had > made a complete and irrevocable ass of myself. > > On Fri, Jun 12, 2009 at 10:36 AM, Ben Mab

Re: [rspec-users] RSpec not failing when requesting missing method/view

2009-06-27 Thread mBread
David Chelimsky-2 wrote: > > That is by design. RSpec is about spec'ing things in isolation, > whereas cucumber is about spec'ing things end to end. RSpec controller > specs are about *controllers*, not views, so the presence and/or > validity of a view should not impact the controller spec. >

Re: [rspec-users] what does :save => true mean in mock_model ?

2009-06-27 Thread David Chelimsky
On Sat, Jun 27, 2009 at 10:55 AM, Zhenning Guan wrote: > one more question. > Forecast.stub!(:new).and_return(@forecast) > Forecast.should_receive(:new).with(anything()).and_return(@forecast) > > what's the different between stub! and should_receive ? Read this: http://rspec.info/documentation/moc

Re: [rspec-users] what does :save => true mean in mock_model ?

2009-06-27 Thread Zhenning Guan
one more question. Forecast.stub!(:new).and_return(@forecast) Forecast.should_receive(:new).with(anything()).and_return(@forecast) what's the different between stub! and should_receive ? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing

Re: [rspec-users] what does :save => true mean in mock_model ?

2009-06-27 Thread Zhenning Guan
David Chelimsky wrote: clear, thank you David -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] RSpec not failing when requesting missing method/view

2009-06-27 Thread David Chelimsky
On Sat, Jun 27, 2009 at 10:14 AM, mBread wrote: > I've got this test: > > describe LoginController do > describe "GET index" do > it "should be successful" do > get 'index' > response.should be_success > end > end > end > > which passes, but a cucumber test fails on trying t

[rspec-users] RSpec not failing when requesting missing method/view

2009-06-27 Thread mBread
I've got this test: describe LoginController do describe "GET index" do it "should be successful" do get 'index' response.should be_success end end end which passes, but a cucumber test fails on trying to get the index for LoginController, with the message: No action r

Re: [rspec-users] what does :save => true mean in mock_model ?

2009-06-27 Thread David Chelimsky
On Sat, Jun 27, 2009 at 9:55 AM, Zhenning Guan wrote: > @weather  = mock_model(Weather, :id => "1") > @forecast = mock_model(Forecast, :weather => @weather, :save => true) > > what's the different between with :save => true or without it? The hash submitted to mock_model sets up method stubs: @we

[rspec-users] what does :save => true mean in mock_model ?

2009-06-27 Thread Zhenning Guan
@weather = mock_model(Weather, :id => "1") @forecast = mock_model(Forecast, :weather => @weather, :save => true) what's the different between with :save => true or without it? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec