spec/utopia/controller/respond_spec/api/controller.rb in utopia-1.3.1 vs spec/utopia/controller/respond_spec/api/controller.rb in utopia-1.3.2
- old
+ new
@@ -1,8 +1,7 @@
prepend Respond
-
respond.with_json
class VersionedResponse
def to_json(options = {})
JSON::dump(self.as_json(options))
@@ -12,9 +11,11 @@
def as_json(options = {})
if options[:version] == '1'
{"message" => "Hello World"}
elsif options[:version] == '2'
{"message" => "Goodbye World"}
+ else
+ {}
end
end
end
# To get different verions of the response, use: