in localweb_twitter_spec.rb:8, should be “described_class”. See http://recipes.sinatrarb.com/p/testing/rspec “If your app was defined using the _modular_ style”
Thanks and Kindest Regards, Peter Fitzgibbons (224) 307-9689 On Wed, Feb 1, 2017 at 10:20 AM, Elton Santos <[email protected]> wrote: > Hi, I have a giant problem that I'm 5 days stuck!!! I have a app: > > https://github.com/eltonsantos/locaweb-twitter > > But Can't work with tests. Look: > > it "Has response HTTP 200" do > get "/" > puts last_response.inspect > expect(last_response).to have_http_status(:success) > end > > In inspect return this: > > #<Rack::MockResponse:0x007fbc948c2f50 @original_headers={"Content-Ty > pe"=>"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’t know this > ditty.</h2>*\n <img src='http://example.org/__sinatra__/404.png'>\n > <div id=\"c\">\n Try this:\n <pre>get '/' do\n > "Hello World"\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 :( > No one test with Rspec work :( > > -- > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > --- > You received this message because you are subscribed to the Google Groups > "SD Ruby" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
