Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
> describe BbPostsController do > context "test" do > fixtures :bb_posts, :users > it "should create post" do > User.find_by_login("amit").should_not be_nil > post = create_post > post.should be_valid > end > end > end > > (that's an odd spec but let's try to get

Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
David Chelimsky wrote: > On Thu, Jun 11, 2009 at 11:50 AM, Amit Kulkarni > wrote: >> � require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') >> � �if @user >> �id: 1 >> amit: >> I dont know what is wrong. >> Please suggest :-) > > Make sure that the fixtures are in the same place t

Re: [rspec-users] I am having a problem testing a date in a rails view

2009-06-11 Thread David Chelimsky
On Thu, Jun 11, 2009 at 10:36 PM, powertoaster wrote: > > I see June 13, 2009 on my index page when running in development. > > I get this > 2. > is not true. This is not an rspec failure message. What other gems do you have at play? Also, what versions of rspec, rspec-rails, ruby, rails, OS, et

[rspec-users] I am having a problem testing a date in a rails view

2009-06-11 Thread powertoaster
I see June 13, 2009 on my index page when running in development. I get this 2. is not true. require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe "/timesheets/index.html.erb" do include TimesheetsHelper before(:each) do assigns[:timesheets] = [

Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Pat Maddox
On Thu, Jun 11, 2009 at 9:50 AM, Amit Kulkarni wrote: > describe BbPostsController do >  context "test" do >    fixtures :bb_posts, :users >   �...@user = User.find_by_login("amit") >    if @user >      it "should create post" do >        post = create_post >        post.should be_valid >      end

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

2009-06-11 Thread Rick DeNatale
On Thu, Jun 11, 2009 at 2:48 PM, Stephen Eley wrote: > So...  In the recent five-hundred-and-forty-seventh iteration of the > "What's the point of mocks?" discussion on this list, David Chelimsky > ended a message with: > >> [ . . . ]   Really, I think >> that's what we should all be striving for.

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Stephen Eley
On Thu, Jun 11, 2009 at 12:56 PM, David Chelimsky wrote: > > This may be true in some cases, but generally with validations the > controller passes the params straight through to the model without > caring about them in any way. In those cases, where the controller is > only interacting with method

[rspec-users] The problem with learning RSpec

2009-06-11 Thread Stephen Eley
So... In the recent five-hundred-and-forty-seventh iteration of the "What's the point of mocks?" discussion on this list, David Chelimsky ended a message with: > [ . . . ] Really, I think > that's what we should all be striving for. Not so much "should I use > mocks or not," but "when should I

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread David Chelimsky
On Thu, Jun 11, 2009 at 11:36 AM, Stephen Eley wrote: > (NOTE: This reply is no longer really for Amit's benefit any more. > What David said made perfect sense as an answer to the original > question.  Now I'm just spinning off into theory.) > > ((But David -- if the repetition of this whole argume

Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread David Chelimsky
On Thu, Jun 11, 2009 at 11:50 AM, Amit Kulkarni wrote: > Hi, > >   I am running controller spec and it gives me result as 0 examples, 0 > failures. > >   I checked into the database and i saw that fixtures are not loaded. > >   Following are the details of my controller file. > > >   require File.e

[rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
Hi, I am running controller spec and it gives me result as 0 examples, 0 failures. I checked into the database and i saw that fixtures are not loaded. Following are the details of my controller file. require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') def valid_bb_

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Stephen Eley
(NOTE: This reply is no longer really for Amit's benefit any more. What David said made perfect sense as an answer to the original question. Now I'm just spinning off into theory.) ((But David -- if the repetition of this whole argument On Thu, Jun 11, 2009 at 9:36 AM, David Chelimsky wrote: > >

Re: [rspec-users] Textmate Bundle focussed test

2009-06-11 Thread David Chelimsky
On Thu, Jun 11, 2009 at 4:49 AM, John van Dijk wrote: > When running a focussed (single) example in textmate and have no > description like this: > > it { should do_something } > > I get not the desired effect :) > > Is there a way to get this to work? The mechanism for running focused examples re

[rspec-users] Textmate Bundle focussed test

2009-06-11 Thread John van Dijk
When running a focussed (single) example in textmate and have no description like this: it { should do_something } I get not the desired effect :) Is there a way to get this to work? (When running all examples this is no problem and works fine) regards, j. _

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread David Chelimsky
On Thu, Jun 11, 2009 at 4:39 AM, Amit Kulkarni wrote: > Matt Wynne wrote: >> On 11 Jun 2009, at 08:17, Amit Kulkarni wrote: >> > >>> those objects. >>> it >>> be fine? >> >> If you're writing the specs after you've written the code, you're >> losing a lot of the value of mock objects. > > Actua

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Amit Kulkarni
Matt Wynne wrote: > On 11 Jun 2009, at 08:17, Amit Kulkarni wrote: > >> those objects. >> it >> be fine? > > If you're writing the specs after you've written the code, you're > losing a lot of the value of mock objects. Actually i am writing specs before the code is written.I saw many exam

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Matt Wynne
On 11 Jun 2009, at 08:17, Amit Kulkarni wrote: David Chelimsky wrote: On Wed, Jun 10, 2009 at 5:55 AM, Amit Kulkarni wrote: Hello, � � �I had seen many controller spec using mock and stub objects. � � �I had written controller spec earlier without these objects. � � �In the book it i

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Amit Kulkarni
David Chelimsky wrote: > On Wed, Jun 10, 2009 at 5:55 AM, Amit Kulkarni > wrote: >> Hello, >> >> � � �I had seen many controller spec using mock and stub objects. >> >> � � �I had written controller spec earlier without these objects. >> >> � � �In the book it is mention about mock and stub object