예제 #1
0
파일: editor_test.go 프로젝트: fxnn/gone
func TestEditUIMissingWritePermission(t *testing.T) {

	var response = httptest.NewRecorder()
	var request = getRequest(t, "/someFile?edit")
	var store = mockstore.New()
	var sut = createSut(store)

	store.GivenReadAccess()
	store.GivenMimeType("text/plain")
	sut.ServeHTTP(response, request)

	assertResponseBodyNotEmpty(t, response)
	assertResponseCode(t, response, http.StatusUnauthorized)

}
예제 #2
0
파일: editor_test.go 프로젝트: fxnn/gone
func TestEditUINotExists(t *testing.T) {

	var response = httptest.NewRecorder()
	var request = getRequest(t, "/someFile?edit")
	var store = mockstore.New()
	var sut = createSut(store)

	store.GivenNotExists()
	store.GivenReadAccess()
	store.GivenWriteAccess()
	sut.ServeHTTP(response, request)

	assertResponseBodyNotEmpty(t, response)
	assertResponseCode(t, response, http.StatusNotFound)

}