ruby on rails - Using Capybara matchers in a controller spec with ActionController::TestResponse -


i'm calling render_views in rspec controller spec can test content of response directly rather using separate view specs.

sure enough view rendered , returned in response.body.

the problem how parse content of page in expressive way. i'm trying use capybara matchers has_content, has_field etc. work fine in request specs, don't work actioncontroller::testresponse or string returned .body.

where's rspec api parsing view?

what's point of render_views if can't inspect them?

if want spec rendered views suggest in request/acceptance/feature spec, not controller. controller specs should treated more unit specs controllers. render_views can used if want make sure view renders without problems, shouldn't go deeper in terms of speccing view.


Comments

Popular posts from this blog

jQuery Ajax Render Fragments OR Whole Page -

javascript - Iterate over array and calculate average values of array-parts -

java - Simple Command Line calculator -