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

2008-07-22 Thread Teedub
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. Teedub On Jul 21, 1:01 am, Rahoul Baruah [EMAIL PROTECTED] wrote: On 21 Jul 2008, at 08:27, David

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

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. AFAIK, the

[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 much

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 development

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 testing

[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 =

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)

[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

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 #Class:0x7faf42964d00 This is a kludge, but you might be able to work around your situation using

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