remotestorage / api-test-suite

Test suite for RS server REST APIs
MIT License
6 stars 2 forks source link

Content-Type of folder must be application/ld+json #9

Closed ghost closed 9 years ago

ghost commented 9 years ago

The Content-Type of a folder response should be application/ld+json according to the -03 spec and not application/json.

ghost commented 9 years ago
diff --git a/api_spec.rb b/api_spec.rb
index 16df4e2..0409fa1 100644
--- a/api_spec.rb
+++ b/api_spec.rb
@@ -261,7 +261,7 @@ describe "Requests" do
     it "works" do
       @res.code.must_equal 200
       @res.headers[:etag].must_be_etag
-      @res.headers[:content_type].must_equal "application/json"
+      @res.headers[:content_type].must_equal "application/ld+json"
       @res.body.must_equal ""
     end
   end
@@ -275,7 +275,7 @@ describe "Requests" do
     it "works" do
       @res.code.must_equal 200
       @res.headers[:etag].must_be_etag
-      @res.headers[:content_type].must_equal "application/json"
+      @res.headers[:content_type].must_equal "application/ld+json"

       @listing["@context"].must_equal "http://remotestorage.io/spec/folder-description"
       @listing["items"].each_pair do |key, value|
@@ -307,7 +307,7 @@ describe "Requests" do
     it "works" do
       @res.code.must_equal 200
       @res.headers[:etag].must_be_etag
-      @res.headers[:content_type].must_equal "application/json"
+      @res.headers[:content_type].must_equal "application/ld+json"
       @res.body.must_equal ""
     end
   end
@@ -321,7 +321,7 @@ describe "Requests" do
     it "works" do
       @res.code.must_equal 200
       @res.headers[:etag].must_be_etag
-      @res.headers[:content_type].must_equal "application/json"
+      @res.headers[:content_type].must_equal "application/ld+json"

       @listing["@context"].must_equal "http://remotestorage.io/spec/folder-description"
       @listing["items"].each_pair do |key, value|
ghost commented 9 years ago

You could also support both application/json and application/ld+json I guess...

raucao commented 9 years ago

Yes, definitely. We should introduce warnings for "should"s, though. ;)