Don't leave any data behind after testing

This commit is contained in:
galfert 2012-09-15 00:39:53 +02:00
parent 8c5993068b
commit 5b78f23406

View File

@ -103,6 +103,10 @@ describe "App with Riak backend" do
put "/jimmy/documents/bar", "another text" put "/jimmy/documents/bar", "another text"
end end
after do
data_bucket.delete("jimmy:documents:bar")
end
it "saves the value" do it "saves the value" do
last_response.status.must_equal 200 last_response.status.must_equal 200
data_bucket.get("jimmy:documents:bar").data.must_equal "another text" data_bucket.get("jimmy:documents:bar").data.must_equal "another text"
@ -124,6 +128,10 @@ describe "App with Riak backend" do
put "/jimmy/documents/jason", '{"foo": "bar", "unhosted": 1}' put "/jimmy/documents/jason", '{"foo": "bar", "unhosted": 1}'
end end
after do
data_bucket.delete("jimmy:documents:jason")
end
it "saves the value (as JSON)" do it "saves the value (as JSON)" do
last_response.status.must_equal 200 last_response.status.must_equal 200
data_bucket.get("jimmy:documents:jason").data.must_be_kind_of Hash data_bucket.get("jimmy:documents:jason").data.must_be_kind_of Hash
@ -192,6 +200,10 @@ describe "App with Riak backend" do
header "Authorization", "Bearer 321" header "Authorization", "Bearer 321"
end end
after do
storage_client.bucket("authorizations").delete("jimmy:123")
end
describe "GET" do describe "GET" do
it "returns a 403" do it "returns a 403" do
get "/jimmy/documents/foo" get "/jimmy/documents/foo"