sabredav_client 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sabredav_client/events.rb +2 -0
- data/lib/sabredav_client/version.rb +1 -1
- data/spec/sabredav_client/events_spec.rb +26 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09c3b341d38c5d61c5af212eef534715dd2af8d
|
4
|
+
data.tar.gz: 2d32cde34531ea583dd10f987269bc1dd78da9e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39d91dc553f80a8478538622623d7241372a281d490d7567f309e4689064c7cfa9b2edeebb60f4f2f2034e59611edda4cbee7d07edd7491813dd9964fe2c401b
|
7
|
+
data.tar.gz: 7b415d80e04584b6789362b98ad571e431fa0c6bfef5ea63c5e8694dd618fae7c50d294871599b061425b2877db2908ea7d6776b9f297a23d5a4e0a5d5497b13
|
@@ -17,14 +17,35 @@ describe SabredavClient::Events do
|
|
17
17
|
it "one event" do
|
18
18
|
uri = "event.ics"
|
19
19
|
FakeWeb.register_uri(:delete, "http://user@localhost:5232/user/calendar/#{uri}",
|
20
|
-
[{:body => "1 deleted.", :status => ["200", "OK"]}
|
21
|
-
{:body => "not found", :status => ["404", "Not Found"]}])
|
20
|
+
[{:body => "1 deleted.", :status => ["200", "OK"]}])
|
22
21
|
r = events.delete(uri)
|
23
22
|
|
24
23
|
expect(r).to be(true)
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
end
|
25
|
+
|
26
|
+
context "error" do
|
27
|
+
it "raises error if etag not includes .ics" do
|
28
|
+
uri = nil
|
29
|
+
|
30
|
+
expect {
|
31
|
+
events.delete(uri)
|
32
|
+
}.to raise_error(SabredavClient::Errors::SabredavClientError)
|
33
|
+
|
34
|
+
uri = "x-vvvvvv-sssss-2122222-xssw"
|
35
|
+
|
36
|
+
expect {
|
37
|
+
events.delete(uri)
|
38
|
+
}.to raise_error(SabredavClient::Errors::SabredavClientError)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "it raises error NotFoundError if resource was not found" do
|
42
|
+
uri = "event.ics"
|
43
|
+
FakeWeb.register_uri(:delete, "http://user@localhost:5232/user/calendar/#{uri}",
|
44
|
+
[{:body => "not found", :status => ["404", "Not Found"]}])
|
45
|
+
expect {
|
46
|
+
events.delete(uri)
|
47
|
+
}.to raise_error(SabredavClient::Errors::NotFoundError)
|
48
|
+
end
|
28
49
|
end
|
29
50
|
end
|
30
51
|
|