Re: [rspec-users] Spec'ing ApplicationController

2007-08-27 Thread Priit Tamboom
On 8/28/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/14/07, sbellware <[EMAIL PROTECTED]> wrote: > > > > Folks, > > > > I'd like to spec the behaviors that I'm adding to ApplicationController. > > Specifically, I'm adding: > > > > def authenticated? > > session[:username] != nil > > end

Re: [rspec-users] issue with edge rails and urls

2007-08-27 Thread Jim Deville
On Aug 27, 2007, at 12:52 PM, J.D. Hollis wrote: > I just switched our project over to Edge Rails, and I'm running into > this problem with all of my helper methods that call _url methods: > > NoMethodError in 'ApplicationHelper home_link should generate a valid > home link when User.current and

Re: [rspec-users] Spec'ing ApplicationController

2007-08-27 Thread David Chelimsky
On 8/14/07, sbellware <[EMAIL PROTECTED]> wrote: > > Folks, > > I'd like to spec the behaviors that I'm adding to ApplicationController. > Specifically, I'm adding: > > def authenticated? > session[:username] != nil > end > > I described ApplicationController, but couldn't figure out how to call

[rspec-users] Spec'ing ApplicationController

2007-08-27 Thread sbellware
Folks, I'd like to spec the behaviors that I'm adding to ApplicationController. Specifically, I'm adding: def authenticated? session[:username] != nil end I described ApplicationController, but couldn't figure out how to call the authenticated method. I'm probably going about this quite wro

Re: [rspec-users] issue with edge rails and urls

2007-08-27 Thread Jay Levitt
J.D. Hollis wrote: > I just switched our project over to Edge Rails, and I'm running into > this problem with all of my helper methods that call _url methods: Check out the patch at: http://rubyforge.org/tracker/index.php?func=detail&aid=13186&group_id=797&atid=3151 Jay __

[rspec-users] issue with edge rails and urls

2007-08-27 Thread J.D. Hollis
I just switched our project over to Edge Rails, and I'm running into this problem with all of my helper methods that call _url methods: NoMethodError in 'ApplicationHelper home_link should generate a valid home link when User.current and Profile.current is not set' You have a nil object when y

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
Jim Deville wrote: >> > > Just wondering about your usage of constraints. We ran into this > issue recently and came to the conclusion that unless profiling shows > an issue, use AR to enforce referential integrity. You might be able > to get by using :dependent => :destroy, or one of the o

Re: [rspec-users] Testing arbitrary SQL

2007-08-27 Thread Rodrigo Alvarez Fernández
On 8/27/07, Courtenay <[EMAIL PROTECTED]> wrote: > You create the records. I guess that I need to hit the database to really test if the method is working at all. In fact what I must test is the SQL query itself. Thanks. > > @bah = Bah.create! > [1, 5, 22, 16].each { |amount| Foo.create! :am

Re: [rspec-users] Testing arbitrary SQL

2007-08-27 Thread Courtenay
You create the records. @bah = Bah.create! [1, 5, 22, 16].each { |amount| Foo.create! :amount => amount, :bah => @bah } @bah.foos.should == 44 On 8/27/07, Rodrigo Alvarez Fernández <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know how would you test a method in a model that uses >

[rspec-users] Testing arbitrary SQL

2007-08-27 Thread Rodrigo Alvarez Fernández
Hi, I would like to know how would you test a method in a model that uses complex a SQL query that joins several tables in order to make a calculation. I suppose that I need fixtures, although my approach with rspec is to avoid fixtures and isolate model specs, but none of both seems possible in

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
David Chelimsky wrote: > On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: >> Tilmann Singer wrote: >>> * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: >>>> What's rake doing differently? >>> rake spec isn't doing anything fundamental

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Ben Mabey
his code with rpsec but since rspec uses rails Fixtures class (right?) you should be able to use this as well. -Ben Jim Deville wrote: > On Aug 27, 2007, at 8:08 AM, David Chelimsky wrote: > > >> On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: >> >>>

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jim Deville
On Aug 27, 2007, at 8:08 AM, David Chelimsky wrote: > On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: >> Tilmann Singer wrote: >>> * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: >>>> What's rake doing differently? >>> >>>

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread David Chelimsky
On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: > Tilmann Singer wrote: > > * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: > >> What's rake doing differently? > > > > rake spec isn't doing anything fundamentally different, but the order

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
Tilmann Singer wrote: > * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: >> What's rake doing differently? > > rake spec isn't doing anything fundamentally different, but the order > the specs are run is propably randomly different from when you run > the

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Tilmann Singer
* Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: > I've got a spec that loads a fixture in the "before" block. This works > fine running scripts/spec, but when I run rake spec instead, I get: > > ActiveRecord::StatementInvalid in 'User in fixture :quenti

Re: [rspec-users] Testing c code with rspec?

2007-08-27 Thread Wincent Colaiuta
El 27/8/2007, a las 6:00, Steven R. Baker escribió: > Ben Mabey wrote: >> Hey all, >> Has any one ever tested or try to test c code with rspec? I am using >> system calls to my compiled c program and testing against the >> standard >> output but I would like to get a lot more granular than this