Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update specs

  • Loading branch information...
commit 147cec0fed7b9016c1b5c1c4211d9e48636cb6ba 1 parent db7146e
@oestrich authored
View
6 spec/example_spec.rb
@@ -50,13 +50,13 @@
it "should have the body" do
within("#request-0 .body") do
- page.should have_content(%{"order": \{})
+ find("textarea").text.should =~ /"order":{/
end
end
it "should have the curl output" do
within("#request-0 .curl") do
- page.should have_content("curl http://localhost:3000/orders")
+ page.should have_content("curl \"http://localhost:3000/orders\"")
end
end
@@ -75,7 +75,7 @@
it "should have the body" do
within("#request-0 .response .body") do
- page.should have_content(%{"email": "email@example.com",})
+ find("textarea").text.should =~ /"email":"email@example\.com"/
end
end
end
View
2  spec/fixtures/orders/creating_an_order.json
@@ -1 +1 @@
-{"resource":"Orders","description":"Creating an order","explanation":null,"parameters":[{"name":"name","description":"Name of order","required":true,"scope":"order"},{"name":"paid","description":"If the order has been paid for","required":true,"scope":"order"},{"name":"email","description":"Email of user that placed the order","scope":"order"}],"requests":[{"request_method":"POST","request_path":"/orders","request_body":"<div class=\"CodeRay\">\n <div class=\"code\"><pre>{\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>order</span><span style=\"color:#404\">&quot;</span></span>: {\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>name</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">Order 1</span><span style=\"color:#710\">&quot;</span></span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>paid</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"color:#088\">true</span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>email</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">email@example.com</span><span style=\"color:#710\">&quot;</span></span>\n }\n}</pre></div>\n</div>\n","request_headers":"Accept: application/json\nContent-Type: application/json\nHost: example.org\nCookie: ","request_query_parameters":null,"response_status":201,"response_status_text":"Created","response_body":"<div class=\"CodeRay\">\n <div class=\"code\"><pre>{\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>email</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">email@example.com</span><span style=\"color:#710\">&quot;</span></span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>name</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">Order 1</span><span style=\"color:#710\">&quot;</span></span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>paid</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"color:#088\">true</span>\n}</pre></div>\n</div>\n","response_headers":"Content-Type: application/json; charset=utf-8\nLocation: http://example.org/orders/1\nX-Ua-Compatible: IE=Edge,chrome=1\nE-Tag: \"5fffd66f61cdd4ab8881584dbf5e72cf\"\nCache-Control: max-age=0, private, must-revalidate\nX-Runtime: 0.008631\nContent-Length: 58","curl":"curl http://localhost:3000/orders -d \"{\"order\":{\"name\":\"Order 1\",\"paid\":true,\"email\":\"email@example.com\"}}\" -X POST -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Host: example.org\" -H \"Cookie: \""},{"request_method":"GET","request_path":"/orders/1","request_body":null,"request_headers":"Accept: application/json\nContent-Type: application/json\nHost: example.org\nCookie: ","request_query_parameters":null,"response_status":200,"response_status_text":"OK","response_body":"<div class=\"CodeRay\">\n <div class=\"code\"><pre>{\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>email</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">email@example.com</span><span style=\"color:#710\">&quot;</span></span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>name</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"background-color:hsla(0,100%,50%,0.05)\"><span style=\"color:#710\">&quot;</span><span style=\"color:#D20\">Order 1</span><span style=\"color:#710\">&quot;</span></span>,\n <span style=\"color:#606\"><span style=\"color:#404\">&quot;</span><span>paid</span><span style=\"color:#404\">&quot;</span></span>: <span style=\"color:#088\">true</span>\n}</pre></div>\n</div>\n","response_headers":"Content-Type: application/json; charset=utf-8\nX-Ua-Compatible: IE=Edge,chrome=1\nE-Tag: \"5fffd66f61cdd4ab8881584dbf5e72cf\"\nCache-Control: max-age=0, private, must-revalidate\nX-Runtime: 0.003718\nContent-Length: 58","curl":"curl http://localhost:3000/orders/1 -X GET -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Host: example.org\" -H \"Cookie: \""}]}
+{"resource":"Orders","description":"Creating an order","explanation":"First, create an order, then make a later request to get it back","parameters":[{"name":"name","description":"Name of order","required":true,"scope":"order"},{"name":"paid","description":"If the order has been paid for","required":true,"scope":"order"},{"name":"email","description":"Email of user that placed the order","scope":"order"}],"requests":[{"request_method":"POST","request_path":"/orders","request_body":"{\"order\":{\"name\":\"Order 1\",\"paid\":true,\"email\":\"email@example.com\"}}","request_headers":{"Accept":"application/json","Content-Type":"application/json","Host":"example.org","Cookie":""},"request_query_parameters":{},"request_content_type":"application/json","response_status":201,"response_status_text":"Created","response_body":"{\"email\":\"email@example.com\",\"name\":\"Order 1\",\"paid\":true}","response_headers":{"Content-Type":"application/json; charset=utf-8","Location":"http://example.org/orders/9","X-UA-Compatible":"IE=Edge,chrome=1","ETag":"\"5fffd66f61cdd4ab8881584dbf5e72cf\"","Cache-Control":"max-age=0, private, must-revalidate","X-Runtime":"0.006262","Content-Length":"58"},"response_content_type":"application/json; charset=utf-8","curl":"curl \"http://localhost:3000/orders\" -d \"{\"order\":{\"name\":\"Order 1\",\"paid\":true,\"email\":\"email@example.com\"}}\" -X POST -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Host: example.org\" -H \"Cookie: \""},{"request_method":"GET","request_path":"/orders/9","request_body":null,"request_headers":{"Accept":"application/json","Content-Type":"application/json","Host":"example.org","Cookie":""},"request_query_parameters":{},"request_content_type":"application/json","response_status":200,"response_status_text":"OK","response_body":"{\"email\":\"email@example.com\",\"name\":\"Order 1\",\"paid\":true}","response_headers":{"Content-Type":"application/json; charset=utf-8","X-UA-Compatible":"IE=Edge,chrome=1","ETag":"\"5fffd66f61cdd4ab8881584dbf5e72cf\"","Cache-Control":"max-age=0, private, must-revalidate","X-Runtime":"0.004752","Content-Length":"58"},"response_content_type":"application/json; charset=utf-8","curl":"curl \"http://localhost:3000/orders/9\" -X GET -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Host: example.org\" -H \"Cookie: \""}]}
Please sign in to comment.
Something went wrong with that request. Please try again.