1 # -*- encoding: binary -*-
2 # Copyright (C) 2012-2017 all contributors <omgdav-public@bogomips.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 require './test/integration'
5 class Test_ReadOnly < Minitest::Test
6 include TestMogileFSIntegration
9 resp = @req.put("/foo", input: StringIO.new("HELLO"))
10 assert_equal 201, resp.status.to_i
12 @app = OMGDAV::App.new(@db, @mogc, methods: :ro)
13 @req = Rack::MockRequest.new(@app)
14 resp = @req.put("/foo", input: StringIO.new("GOODBYE"))
15 assert_equal 405, resp.status.to_i
16 status, _, body = req("GET", "/foo")
17 assert_equal 200, status.to_i
18 assert_equal "HELLO", body_string(body)
20 assert_equal 405, req("DELETE", "/foo")[0].to_i