[rspec-users] RSpec a DSL

2008-10-24 Thread Luis Lavena
Hello Guys, I'm creating a small DSL that simplifies the creation of Rake tasks to handle multiple packages and their dependencies. (sorry David, tried Thor, do not do what I need). The thing is that basically I have several classes that "help" constructing the final Rake tasks, and also are not

[rspec-users] using config.gem to freeze rspec (not #577)

2008-10-24 Thread jacobhenry
We have a project running on edge rails that has rspec and rspec-rails 1.1.9 frozen in vendor/gems. To freeze the gems we added two lines of code to environment.rb: config.gem 'rspec-rails', :lib => 'spec/rails', :version => '1.1.9' config.gem 'rspec', :lib => 'spec', :version => '1.1.9' and th

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
Hi All, I got the redirect to work with: def do_post post :create, {:motion => do_motion_input("ten")} end it "creates new proposal with proposer set" do do_post response.should be_success end it "once motion is saved redirects to show motion" do @motion = motions(:ten)

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
Matt Wynne wrote: > On 24 Oct 2008, at 21:57, Harry Bishop wrote: >> Harry Bishop wrote: >>>response.should redirect_to(@motion) > > What is this Motion? is it really something that you can redirect > people to? Maybe you meant redirect_to(url_for(@motion))? > >> private method `split' called

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Matt Wynne
On 24 Oct 2008, at 21:57, Harry Bishop wrote: Harry Bishop wrote: response.should redirect_to(@motion) What is this Motion? is it really something that you can redirect people to? Maybe you meant redirect_to(url_for(@motion))? private method `split' called for #. My guess is that thi

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
Harry Bishop wrote: > Pat Maddox wrote: > >> >> So there are two points you need to address right now: >> * How do you want this action to behave? (success or redirect?) >> * Don't stub behavior that you want to verify (if you want it to >> redirect, let it redirect) >> >> Pat > > Hi Pat, >

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
Pat Maddox wrote: > > So there are two points you need to address right now: > * How do you want this action to behave? (success or redirect?) > * Don't stub behavior that you want to verify (if you want it to > redirect, let it redirect) > > Pat Hi Pat, I am new to rspec and still trying

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Pat Maddox
> controller.stub!(:redirect_to).with(@motion).and_return(true) Well, I bet this is your problem. You're stubbing redirect_to, so there can't possibly be a redirect! Also, the following example doesn't make any sense: > it "create new proposal with proposer set" do > do_post > res

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
Pat Maddox wrote: > Harry Bishop <[EMAIL PROTECTED]> writes: > >> format.html { redirect_to(@motion) } >> >> TIA, >> Harry > > Can you post your example code as well? Also, are there any errors? > Here are my two guesses at this point: > > * you forgot to make a request in the example (

Re: [rspec-users] can't seem to test redirect?

2008-10-24 Thread Pat Maddox
Harry Bishop <[EMAIL PROTECTED]> writes: > I'm posting to the create action and seeing the line "at the motion save > part of create in the following: > > def create > @motion = Motion.new(params[:motion]) > respond_to do |format| > if @motion.save > puts "at the motion sav

[rspec-users] can't seem to test redirect?

2008-10-24 Thread Harry Bishop
I'm posting to the create action and seeing the line "at the motion save part of create in the following: def create @motion = Motion.new(params[:motion]) respond_to do |format| if @motion.save puts "at the motion save part of create" flash[:notice] = 'Motion was su

Re: [rspec-users] Mulitbrowser selenium ruby

2008-10-24 Thread Joseph Wilk
Togetherne Togetherne wrote: Anyone have any ideas on how i can do this using rspec? We run Integration tests across multi browsers simultaneously using Selenium Grid. Perhaps you could use that (I believe it comes with ant tasks that do some of the magic). http://selenium-grid.openqa.org/

[rspec-users] Mulitbrowser selenium ruby

2008-10-24 Thread Togetherne Togetherne
Hope all is well, Striaght to the point I wonder if someone has any ideas to help me with the following problem: I have written an automation framework in ruby, that uses selenium and rspec and is run by an ant task, as thats the build process that is implemented here. Im currently running all m

Re: [rspec-users] How to Spec a Module to be used in a Controller

2008-10-24 Thread Matt Wynne
On 23 Oct 2008, at 14:49, Pat Maddox wrote: Matt Wynne <[EMAIL PROTECTED]> writes: Is this how other people do this? Is there a trick that I'm missing? Yeah, it's kind of a bummer, just something you have to deal with cause of Rails. What I do is set up a default route, you know the old-

Re: [rspec-users] How to Spec a Module to be used in a Controller

2008-10-24 Thread Matt Wynne
On 23 Oct 2008, at 13:51, Stephen Eley wrote: On Thu, Oct 23, 2008 at 7:00 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: This is working OK, but I'm struggling with the routing so that I can use the integration session #get method to spin up my FakeController. Is that strictly necessary? Yo