[rspec-users] Trivial controller spec fail

2010-03-25 Thread rodrigo benenson
Hello RSpec community ! I'm a Ruby on Rails newby trying to get my first application running. I already got some of the website running and now I'm writting the tests to verify that everything works as expected and that it will stay like that in future versions. However I'm having a really hard ti

Re: [rspec-users] Trivial controller spec fail

2010-03-25 Thread David Chelimsky
On Thu, Mar 25, 2010 at 5:11 AM, rodrigo benenson wrote: > Hello RSpec community ! Welcome, Rodrigo. > I'm a Ruby on Rails newby trying to get my first application running. > I already got some of the website running and now I'm writting the > tests to verify that everything works as expected an

Re: [rspec-users] Problems testing destroy method in rspec2

2010-03-25 Thread David Chelimsky
On Wed, Mar 24, 2010 at 10:39 PM, Mauricio Aniche wrote: > Hi, > I am trying to test the destroy method in my rails 3 controller, but I > always get an "no route matches {}" error. But the route do exist, as I can > see by running rake routes. What version of rspec and rspec-rails are you using?

Re: [rspec-users] Mock "Consent_6335" received unexpected message :marked_for_destruction? with (no args)

2010-03-25 Thread David Chelimsky
On Wed, Mar 24, 2010 at 1:49 PM, thoen wrote: > On Mar 24, 2:39 pm, thoen wrote: >> I have a mock object (Person) that is associated with another object >> (my_object) through a belongs_to association. When I check whether >> my_object is valid (my_object.should be_valid), I am getting an error >

Re: [rspec-users] How to stub a has_many relationship in Rails 2.3.5

2010-03-25 Thread David Chelimsky
On Wed, Mar 24, 2010 at 10:39 AM, Ben Fyvie wrote: > We have a test that has been working find until we upgraded to rails 2.3.5. > I’m not too familiar with mocks/stubs so maybe there is an easy solution. > > Here is a simple example of our scenario. > > Class Person < ActiveRecord::Base >   has_m

Re: [rspec-users] Problems testing destroy method in rspec2

2010-03-25 Thread Mauricio Aniche
Hi David, I am using rspec2 beta4, which is the latest version in gemcutter. Hi Julian, The problem only happens in my spec. My rails3 applications works fine (I use a post with a hidden _method set as delete, but I guess this is a browser problem!) Regards, Mauricio On 3/25/10, David Chelimsk

Re: [rspec-users] Mock Global method

2010-03-25 Thread garren
I'm actually looking to mock "my_helper_method" here. Or to be more general any method that is created outside of a class. On Mar 25, 6:27 am, "J. B. Rainsberger" wrote: > garren wrote: > > I'm very new to ruby and mocking a dynamic language. I would like to > > mock a helper method in Sinatra. S

Re: [rspec-users] Mock Global method

2010-03-25 Thread David Chelimsky
On Mar 25, 2010, at 8:44 AM, garren wrote: > I'm actually looking to mock "my_helper_method" here. Or to be more > general any method that is created outside of a class. When you create a method outside a class, it is available on every object: def foo "foo" end class Bar end describe Bar do

Re: [rspec-users] Specing Ruby Game Development ???

2010-03-25 Thread Peter Fitzgibbons
Let the blogging begin : http://peter.fitzgibbons.info/2010/03/gosu-star-catcher-iteration-0/ Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibb...@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibb...@gmail.com On Wed, Mar 24, 2010 at 10:15 PM, Pat Maddox wrote: > Not I, but let

Re: [rspec-users] Trivial controller spec fail

2010-03-25 Thread rodrigo benenson
> If you're rendering another action in Rails, this should read: >  render :action => "teaser_v1" I changed the teaser_controller.rb as mentioned. It makes no difference, I get the exact same error. Please notice that, as mentioned, the application does run correctly. I already tried it manually,

Re: [rspec-users] view spec template.base_path

2010-03-25 Thread Phillip Koebbe
On 2010-03-25 1:42 PM, Phillip Koebbe wrote: I have a helper method def partial_path_for(partial, options = {}) base_path = options[:base_path] || self.template.base_path "_partials/#{base_path}/#{partial}" end and use it in a template (haml) like = render :partial => partial_path_fo

[rspec-users] view spec template.base_path

2010-03-25 Thread Phillip Koebbe
I have a helper method def partial_path_for(partial, options = {}) base_path = options[:base_path] || self.template.base_path "_partials/#{base_path}/#{partial}" end and use it in a template (haml) like = render :partial => partial_path_for(:details) I'd like to have a similar helper