Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-22 Thread Bart Zonneveld
On 22-jul-2008, at 6:43, Teedub wrote: Thanks rake db:test:prepare did the trick. I am still a bit confused as to why rake cares about a database that it isn't using. But I guess that will all fall into place in my brain one day. Well, the test database is for ehrm, testing :). So rake is act

Re: [rspec-users] Failing on rake but not on textmate (rails)

2008-07-22 Thread Rick DeNatale
On Mon, Jul 21, 2008 at 8:34 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Mon, Jul 21, 2008 at 4:33 PM, Macario Ortega <[EMAIL PROTECTED]> > wrote: > >> >> I have a spec for a model that passes all tests if I run it using >> textmate but I run rake some of the otherwise passed tests fail. >> >

[rspec-users] Funny single line of rspec_code

2008-07-22 Thread Britt Mileshosky
So lastnight I was writing a fake controller to test some before filter action. I found myself writing this line of code that I thought was funny ... maybe its a subtle indication i've been programming to much lately. get :some_action HA! _

Re: [rspec-users] Funny single line of rspec_code

2008-07-22 Thread David Chelimsky
On Tue, Jul 22, 2008 at 11:26 AM, Britt Mileshosky <[EMAIL PROTECTED]> wrote: > > So lastnight I was writing a fake controller to test some before filter > action. > I found myself writing this line of code that I thought was funny ... maybe > its > a subtle indication i've been programming to mu

Re: [rspec-users] Failing on rake but not on textmate (rails)

2008-07-22 Thread Macario Ortega
Mark Wilden wrote: > On Mon, Jul 21, 2008 at 4:33 PM, Macario Ortega <[EMAIL PROTECTED]> > wrote: > >> >> I have a spec for a model that passes all tests if I run it using >> textmate but I run rake some of the otherwise passed tests fail. >> > > AFAIK, the main difference is that rake copies the

Re: [rspec-users] Failing on rake but not on textmate (rails)

2008-07-22 Thread Steve Eley
On Tue, Jul 22, 2008 at 1:56 PM, Macario Ortega <[EMAIL PROTECTED]> wrote: > > Well I don't trust autotest because the same tests pass when i run them > from textmate and they fail when I run autotest. > > The dubbious specs are all for a specific model but some of them are > very basic such as tes

[rspec-users] [HELP] should receive :new but does not

2008-07-22 Thread Camilo Torres
Hello, I am learning rspec/rspec-rails and ruby on rails. Controller: class IssuesController < ApplicationController def index end def new @issue = Issue.new end def create @issue = Issue.new

Re: [rspec-users] [HELP] should receive :new but does not

2008-07-22 Thread Maurício Linhares
The "should_receive" should appear before the "post :create" (look at this for a better explanation -> http://rubyforge.org/pipermail/rspec-users/2008-June/007342.html ) it 'should not save the issue' do @issue = mock_model(Issue) @issue

Re: [rspec-users] [HELP] should receive :new but does not

2008-07-22 Thread Camilo Torres
thanks Maurício, I read your link. It worked. 2008/7/23 Maurício Linhares <[EMAIL PROTECTED]>: > The "should_receive" should appear before the "post :create" (look at > this for a better explanation -> > http://rubyforge.org/pipermail/rspec-users/2008-June/007342.html ) > > it 'shoul

[rspec-users] Rspec - stubbing same class multiple times with different co

2008-07-22 Thread Ry An
Im having a hard time with a rspec controller test im writting, I need to stub! the User.find call twice once to return the owning user and once to return the viewing user. however when I attempt User.stub!(:find).with(1).and_return(@user) User.stub!(:find).with(2).and_return(@user2) the second c

Re: [rspec-users] Rspec - stubbing same class multiple times with different co

2008-07-22 Thread Lori M Olson
Have you tried using should_receive instead of stub! ? Sent from my iPhone On 22-Jul-08, at 8:37 PM, Ry An <[EMAIL PROTECTED]> wrote: Im having a hard time with a rspec controller test im writting, I need to stub! the User.find call twice once to return the owning user and once to return the v

Re: [rspec-users] Rspec - stubbing same class multiple times with different co

2008-07-22 Thread Tero Tilus
2008-07-23 04:37, Ry An: > User.stub!(:find).with(1).and_return(@user) > User.stub!(:find).with(2).and_return(@user2) > > the second call returns > undefined local variable or method `find' for > # This is a kludge, but you might be able to work around your situation using User.stub!(:find).an

Re: [rspec-users] Rspec - stubbing same class multiple times with different co

2008-07-22 Thread David Chelimsky
On Tue, Jul 22, 2008 at 9:37 PM, Ry An <[EMAIL PROTECTED]> wrote: > Im having a hard time with a rspec controller test im writting, I need > to stub! the User.find call twice once to return the owning user and > once to return the viewing user. however when I attempt > > User.stub!(:find).with(1).a