func TestLongPath(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	// Setup the test server.
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("content", "blog", NewTestHandler("default", assert))
	assert.Nil(err)
	// Perform test requests.
	req := restaudit.NewRequest("GET", "/base/content/blog/2014/09/30/just-a-test")
	resp := ts.DoRequest(req)
	resp.AssertBodyContains(`Resource ID: 2014/09/30/just-a-test`)
	// Now with path elements.
	req = restaudit.NewRequest("GET", "/base/content/blog/2014/09/30/just-another-test")
	req.AddHeader(restaudit.HeaderAccept, rest.ContentTypePlain)
	resp = ts.DoRequest(req)
	resp.AssertBodyContains(`0: "content" 1: "blog" 2: "2014" 3: "09" 4: "30" 5: "just-another-test" 6: "" J: "2014/09/30/just-another-test"`)
}
// TestLongPath tests the setting of long path tail as resource ID.
TestLongPath tests the setting of long path tail as resource ID.
// TestLongPath tests the setting of long path tail as resource ID .
func TestLongPath(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("content", "blog", NewTestHandler("default", assert))
	assert.Nil(err)
	req := restaudit.NewRequest("GET", "/base/content/blog/2014/09/30/just-a-test")
	resp := ts.DoRequest(req)
	resp.AssertBodyContains(`Resource ID: 2014/09/30/just-a-test`)
	req = restaudit.NewRequest("GET", "/base/content/blog/2014/09/30/just-another-test")
	req.AddHeader(restaudit.HeaderAccept, rest.ContentTypePlain)
	resp = ts.DoRequest(req)
	resp.AssertBodyContains(`0: "content" 1: "blog" 2: "2014" 3: "09" 4: "30" 5: "just-another-test" 6: "" J: "2014/09/30/just-another-test"`)
}
func TestLongPath ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) mux := newMultiplexer ( assert ) ts := restaudit . StartServer ( mux , assert ) defer ts . Close ( ) err := mux . Register ( " " , " " , NewTestHandler ( " " , assert ) ) assert . Nil ( err ) req := restaudit . NewRequest ( " " , " " ) resp := ts . DoRequest ( req ) resp . AssertBodyContains ( `Resource ID: 2014/09/30/just-a-test` ) req = restaudit . NewRequest ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , rest . ContentTypePlain ) resp = ts . DoRequest ( req ) resp . AssertBodyContains ( `0: "content" 1: "blog" 2: "2014" 3: "09" 4: "30" 5: "just-another-test" 6: "" J: "2014/09/30/just-another-test"` ) }
TestLongPath tests the setting of long path tail as resource ID.
TestLongPath tests the setting of long path tail as resource ID .
// Setup the test server. // Perform test requests. // Now with path elements.