That is, after a post, response.body is just the controller/view string
(“user/login” in my case).
Failing to find any answer on the web, I’m trying to trace execution,
but
hitting a bit of a snag. I’m tracing the ancestry of self inside a test
example to see where the “post” function is actually defined. I’m
getting a
hit on Spec::Rails::Example::FunctionalExampleGroup, but I cannot find
where
it is defined in this module!
???
I’m having the same problem. Did you ever solve this? I’m using Rails
1.2.6 - I recently ran a conversion plugin to convert my Test::Unit
tests to Rspec. Everything is working fine except this - response.body
just returns the template name.
Test::Unit:
xhr(:post, :add_to_cart_xhr, …)
assert_match(/Quantity is not a number/, @response.body) # <–passes
Rspec
xhr(:post, :add_to_cart_xhr, …)
response.body.should match(/Quantity is not a number/) #<–fails
That is, after a post, response.body is just the controller/view string
(“user/login” in my case).
Failing to find any answer on the web, I’m trying to trace execution,
but
hitting a bit of a snag. I’m tracing the ancestry of self inside a test
example to see where the “post” function is actually defined. I’m
getting a
hit on Spec::Rails::Example::FunctionalExampleGroup, but I cannot find
where
it is defined in this module!
???
Found the problem. Was not calling integrate_views at the start of the
describe block.
Chris S. wrote:
I’m having the same problem. Did you ever solve this? I’m using Rails
1.2.6 - I recently ran a conversion plugin to convert my Test::Unit
tests to Rspec. Everything is working fine except this - response.body
just returns the template name.
Test::Unit:
xhr(:post, :add_to_cart_xhr, …)
assert_match(/Quantity is not a number/, @response.body) # <–passes
Rspec
xhr(:post, :add_to_cart_xhr, …)
response.body.should match(/Quantity is not a number/) #<–fails
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.