Re: [rspec-users] new syntax question and mocking HTTP_AUTHORIZATION

2010-10-20 Thread David Chelimsky
On Oct 20, 2010, at 9:56 PM, oren wrote: > I am specing a sinatra app. > > it "should send non-valid user to /login" do > get '/' > last_response.headers['Location'].should == '/reports' > end > > this is working fine but I would like to know how to convert it to the > new syntax or if there i

[rspec-users] new syntax question and mocking HTTP_AUTHORIZATION

2010-10-20 Thread oren
I am specing a sinatra app. it "should send non-valid user to /login" do get '/' last_response.headers['Location'].should == '/reports' end this is working fine but I would like to know how to convert it to the new syntax or if there is a better way to do that. before(:each) { get '/' } subj

Re: [rspec-users] rspec 2 - undefined method `redirect_to?' for #

2010-10-20 Thread oren
thanks! On Oct 20, 4:55 am, David Chelimsky wrote: > On Oct 19, 2010, at 9:15 PM, oren wrote: > > > I try to test sinatra app using rspec 2.0.0 and rack-test 0.5.6 > > >  it "redirect non-authenticated user to logout page" do > >    get '/' > >    last_response.should be_redirect_to('/login) > >

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-20 Thread Oscar Del Ben
Thanks for all the replies and the help. On Tue, Oct 19, 2010 at 9:08 PM, David Chelimsky wrote: > On Oct 19, 2010, at 2:04 PM, Pat Maddox wrote: > > > On Oct 19, 2010, at 12:56 AM, Oscar Del Ben wrote: > > > >> I'm having some troubles understanding how to test a couple of things. > Usually, if

Re: [rspec-users] Routing errors with Rails 3.0.1 and Rspec 2.0.1

2010-10-20 Thread Nicholas Wieland
On Oct 19, 2010, at 7:07 PM, Trey wrote: > I'm sure something is borked in my app, but I can't seem to track it > down. Me too, and routing as well ... constraints( :subdomain => /.+/ ) do match '/dashboard' => 'users#show' end it "routes 'http://test.example.com/dashboard' to Users