Ruby on Rails Wednesday, February 1, 2017

Hi, I have a giant problem that I'm 5 days stuck!!! I have a app:

But Can't work with tests. Look:

it "Has response HTTP 200" do
get "/"
      puts last_response
(last_response).to have_http_status(:success)

In inspect return this:

#<Rack::MockResponse:0x007fbc948c2f50 @original_headers={"Content-Type"=>"text/html;charset=utf-8", "X-Cascade"=>"pass", "Content-Length"=>"459", "X-XSS-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff", "X-Frame-Options"=>"SAMEORIGIN"}, @errors="", @body_string=nil, @status=404, @header={"Content-Type"=>"text/html;charset=utf-8", "X-Cascade"=>"pass", "Content-Length"=>"459", "X-XSS-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff", "X-Frame-Options"=>"SAMEORIGIN"}, @chunked=false, @writer=#<Proc:0x007fbc948c28c0@/Users/eltonsantos/.rvm/gems/ruby-2.3.3@sinatra/gems/rack-1.6.5/lib/rack/response.rb:30 (lambda)>, @block=nil, @length=459, @body=["<!DOCTYPE html>\n<html>\n<head>\n  <style type=\"text/css\">\n  body { text-align:center;font-family:helvetica,arial;font-size:22px;\n    color:#888;margin:20px}\n  #c {margin:0 auto;width:500px;text-align:left}\n  </style>\n</head>\n<body>\n  <h2>Sinatra doesn&rsquo;t know this ditty.</h2>\n  <img src=''>\n  <div id=\"c\">\n    Try this:\n    <pre>get &#x27;&#x2F;&#x27; do\n  &quot;Hello World&quot;\nend\n</pre>\n  </div>\n</body>\n</html>\n"]>

How configure sinatra for use with rspec and json??? Serious, I trying but I do not know what to do anymore :(

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment