Re: [rspec-users] template.expect_render fails when partial is rendered from a helper

2008-08-14 Thread J2M
Is this expected behaviour? On Aug 8, 9:46 pm, J2M <[EMAIL PROTECTED]> wrote: > My spec; > >   describe 'subnav rendering while logged in' do > >     before do >       template.stub!(:logged_in?).and_return(true) >       template.stub! > (:current_profile)

[rspec-users] template.expect_render fails when partial is rendered from a helper

2008-08-08 Thread J2M
My spec; describe 'subnav rendering while logged in' do before do template.stub!(:logged_in?).and_return(true) template.stub! (:current_profile).at_least(:once).and_return(mock_profile) end def do_render render "/homepages/show.html.erb" end it "should re

Re: [rspec-users] Rspec doesn't pickup the status code correctly.

2008-08-05 Thread J2M
I'm not having much luck posting here, every other reply seems to go astray! So if I double post sorry! I'm using Rails 2.1 Rspec 1.1.4 Any ideas why this isn't giving the correct response in Rspec but is in the wild? On Aug 4, 4:31 pm, J2M <[EMAIL PROTECTED]> wrote: >

Re: [rspec-users] Rspec doesn't pickup the status code correctly.

2008-08-04 Thread J2M
On Aug 4, 5:16 am, Steve <[EMAIL PROTECTED]> wrote: > J2M wrote: > > I'm setting the status code on a controller action but rspec doesn't > > seem to be catching it in my spec. It works in the browser. > > > This is the controller method, called via xhr w

Re: [rspec-users] Can't access actions of a singular nested resource

2008-08-04 Thread J2M
Zach, Rails 2.1 Rspec 1.1.4 What does your spec look like? Thanks, James On Aug 4, 3:12 pm, "Zach Dennis" <[EMAIL PROTECTED]> wrote: > Bastien, > > What version of Rails and rspec are you using? Using a singular > resource like you presented works just fine for me, > > Zach > > > > On Thu, Jul

Re: [rspec-users] Rspec doesn't pickup the status code correctly.

2008-08-03 Thread J2M
The failure message is; should return conflict 409 expected: 409, got: 200 (using ==) Yes it is nested and the rest of the setup is; before(:each) do request.env["HTTP_ACCEPT"] = "application/json" @account = mock_account @account.stub!(:valid?) Account.stub!(:ne

Re: [rspec-users] Rspec doesn't pickup the status code correctly.

2008-08-03 Thread J2M
It is nested and the rest of the setup is here; before(:each) do request.env["HTTP_ACCEPT"] = "application/json" @account = mock_account @account.stub!(:valid?) Account.stub!(:new).and_return(@account) @errors = { 'login' => 'Not available, try another!' } @

[rspec-users] Rspec doesn't pickup the status code correctly.

2008-08-03 Thread J2M
I'm setting the status code on a controller action but rspec doesn't seem to be catching it in my spec. It works in the browser. This is the controller method, called via xhr with header Accept: 'application/json' def validate account = Account.new(:login => params[:login]) account.vali