Re: [rspec-users] How to write render expectation in Controller Spec?

2011-07-12 Thread Chandu80
Thanks David...I am using jRuby on Rails1.5.0 and following are the details of gems:- rails-2.3.5 rspec-1.3.0 rspec-rails-1.3.2 My script needs to test the create channel method based on a condition given by checkChannel? which I have stubbed as true.If true it should render the action createchann

Re: [rspec-users] Rspec2: checking a view calls a helper

2011-07-12 Thread itsterry
I worked this out In the view spec you need to do something like this: describe "users/index.html.haml" do   before do # this is the bit you need view.stub!(:abc).and_return(whatever_your_helper_returns) # end of the bit you need     render   end   it "stuff" do     rendere

[rspec-users] Specing scopes that use includes()

2011-07-12 Thread Derek Prior
I'm a newcomer to the list. Appologies if this has been discussed before, but all I could find with regards to specing scopes relates to those that filter records or apply sorting. What's the best way to spec a scope that uses the includes method? For instance: class Location < ActiveRecord.Base

Re: [rspec-users] Trouble with RSpec mock "@macropost.should_receive(:save).and_return(true)" -- produces error expected :save with (any args) once, but received it 0 times

2011-07-12 Thread Dean
David: Wow, that's just about the perfect example of a coding help forum reply: Specifically identifies what's going wrong. Suggests a simple solution. Identifies the deeper underlying problem (code that's too bloated, tightly-coupled, or whatever, and thus hard to test) Gently offers a detailed

Re: [rspec-users] How to write render expectation in Controller Spec?

2011-07-12 Thread David Chelimsky
On Jul 12, 2011, at 4:36 AM, Chandu80 wrote: > Hello All, > I am a rspec beginner Welcome! > and I am trying to find a way out to write > render expectation in controller spec. I used the following ways > render '/channels/createchannel.html.erb' > view.should_receive(:render).with(:action => "c

[rspec-users] How to write render expectation in Controller Spec?

2011-07-12 Thread Chandu80
Hello All, I am a rspec beginner and I am trying to find a way out to write render expectation in controller spec.I used the following ways render '/channels/createchannel.html.erb' view.should_receive(:render).with(:action => "createchannel") ChannelsController.expect_render(:action => "createchan

Re: [rspec-users] Rspec or Test:Unit

2011-07-12 Thread Chandu80
Thank you for the info :) Regards Chandrika On Jul 11, 7:00 am, Justin Ko wrote: > On Fri, Jul 8, 2011 at 2:59 AM, Chandu80 wrote: > > Hello All, > > I want to know which out of Rspec and Test:Unit is the most used in > > the industry for unit/integration testing and why? > > http://22ideastre