[rspec-users] Rspec doesn't pickup the status code correctly.
J2M
james2mccarthy at gmail.com
Sun Aug 3 16:29:08 EDT 2008
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!' }
@account.stub!(:errors).and_return( @errors )
@json = {:this => 'that'}.to_json
@format = mock("format", :json => @json )
controller.stub!(:respond_to).and_yield(@format)
end
All the other specs pass the only failure is this being
should return conflict 409
expected: 409,
got: 200 (using ==)
Thanks,
James
On Aug 3, 9:19 pm, "Pat Maddox" <perg... at gmail.com> wrote:
> > it "should return conflict 409" do
> > do_post
> > response.response_code.should == 409
> > end
>
> What is the failure message?
>
> Also, it looks like your before block has not set Account.new to
> return @account, and that @account is nil. Is this a nested describe,
> and there's some other setup happening elsewhere?
>
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list