Bart Zonneveld
2008-Mar-27 11:08 UTC
[rspec-users] Checking for response => head :ok in a story
Hey gang, I''m writing a story in which I update a model via XML. So far, so good. But, I want to test the outcome of the controller, namely the following code: format.xml { head :ok } How can I test this in a story? thanks, bartz
David Chelimsky
2008-Mar-27 12:50 UTC
[rspec-users] Checking for response => head :ok in a story
On Thu, Mar 27, 2008 at 7:08 AM, Bart Zonneveld <loop at superinfinite.com> wrote:> Hey gang, > > I''m writing a story in which I update a model via XML. So far, so > good. But, I want to test the outcome of the controller, namely the > following code: > > format.xml { head :ok } > > How can I test this in a story?Same as in a controller example: response.should be_success response.body.should == "" Cheers, David> > thanks, > bartz > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2008-Mar-27 12:53 UTC
[rspec-users] Checking for response => head :ok in a story
On Thu, Mar 27, 2008 at 8:50 AM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Thu, Mar 27, 2008 at 7:08 AM, Bart Zonneveld <loop at superinfinite.com> wrote: > > Hey gang, > > > > I''m writing a story in which I update a model via XML. So far, so > > good. But, I want to test the outcome of the controller, namely the > > following code: > > > > format.xml { head :ok } > > > > How can I test this in a story? > > Same as in a controller example: > > response.should be_success > response.body.should == ""Or - for the latter ... response.should be_blank Just a matter of preference, but perhaps that''s more readable.> > Cheers, > David > > > > > > > thanks, > > bartz > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > >
Bart Zonneveld
2008-Mar-27 12:56 UTC
[rspec-users] Checking for response => head :ok in a story
On 27 mrt 2008, at 13:53, David Chelimsky wrote:> On Thu, Mar 27, 2008 at 8:50 AM, David Chelimsky > <dchelimsky at gmail.com> wrote: >> On Thu, Mar 27, 2008 at 7:08 AM, Bart Zonneveld <loop at superinfinite.com >> > wrote: >>> Hey gang, >>> >>> I''m writing a story in which I update a model via XML. So far, so >>> good. But, I want to test the outcome of the controller, namely the >>> following code: >>> >>> format.xml { head :ok } >>> >>> How can I test this in a story? >> >> Same as in a controller example: >> >> response.should be_success >> response.body.should == "" > > Or - for the latter ... > > response.should be_blank > > Just a matter of preference, but perhaps that''s more readable.Thanks. I was hoping for a specific test of the head :ok, but this''ll do more than fine :). gr, bartz