Just wondering if anyone else thinks that ''response.should be_success'' is potentially misleading. If you''re writing a spec for an action that is failing in some way it can still have a status 200. So while the HTTP request was technically successful, something in the action was not. Perhaps something like ''response.should have_success_status''? Steve
be_success has the same semantics (and uses) Response#success? and that''s not our API, but Rails'' If you don''t like Rails'' semantics you can make your own matcher, but I don''t want to invent a whole new API on top of Rails in the official Spec::Rails. Aslak On Nov 10, 2007 5:31 PM, Steve <vertebrate at gmail.com> wrote:> Just wondering if anyone else thinks that ''response.should be_success'' is > potentially misleading. If you''re writing a spec for an action that is > failing in some way it can still have a status 200. So while the > HTTP request was technically successful, something in the action > was not. Perhaps something like ''response.should have_success_status''? > > Steve > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On Nov 10, 2007 11:12 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> be_success has the same semantics (and uses) Response#success? and > that''s not our API, but Rails'' > > If you don''t like Rails'' semantics you can make your own matcher, but > I don''t want to invent a whole new API on top of Rails in the official > Spec::Rails.+1 David ps - Aslak, what gives w/ the top posting?> > Aslak > > > On Nov 10, 2007 5:31 PM, Steve <vertebrate at gmail.com> wrote: > > Just wondering if anyone else thinks that ''response.should be_success'' is > > potentially misleading. If you''re writing a spec for an action that is > > failing in some way it can still have a status 200. So while the > > HTTP request was technically successful, something in the action > > was not. Perhaps something like ''response.should have_success_status''? > > > > Steve