<commit_before>describe("Unit tests for custom field collection.", function() {
	it("Test custom field collection instantiated correctly.", function() {
		var webappName = "Sample webapp",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName);
		
		expect(fieldCollection._webappName).toBe(webappName);
		expect(fieldCollection.model).toBe(BCAPI.Models.WebApp.CustomField);
	});
	
	it("Test custom field collection endpoint ok.", function() {
		var webappName = "Sample webapp",
			rootUrl = "http://test.localhost.com",
			expectedBeginUrl = rootUrl + "/api/v2/admin/sites/current/webapps/Sample webapp/fields",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName);
		
		BCAPI.Mocks.Helper.Site(undefined, rootUrl);
		
		expect(fieldCollection.url().substring(0, expectedBeginUrl.length)).toBe(expectedBeginUrl);
		expect(fieldCollection.url()).toContain("limit=" + BCAPI.Config.Pagination.limit);
		expect(fieldCollection.url()).toContain("skip=" + BCAPI.Config.Pagination.skip);
	});	
	
	it("Test custom field collection fetch ok.", function() {
		var webappName = "Sample webapp",
			rootUrl = "http://test.localhost.com",
			expectedUrl = rootUrl + "/api/v2/admin/sites/current/webapps/" + webappName + "/fields",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName),<commit_msg>Removed an assertion on a private field<commit_after>describe("Unit tests for custom field collection.", function() {
	it("Test custom field collection instantiated correctly.", function() {
		var webappName = "Sample webapp",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName);
		
		expect(fieldCollection.model).toBe(BCAPI.Models.WebApp.CustomField);
	});
	
	it("Test custom field collection endpoint ok.", function() {
		var webappName = "Sample webapp",
			rootUrl = "http://test.localhost.com",
			expectedBeginUrl = rootUrl + "/api/v2/admin/sites/current/webapps/Sample webapp/fields",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName);
		
		BCAPI.Mocks.Helper.Site(undefined, rootUrl);
		
		expect(fieldCollection.url().substring(0, expectedBeginUrl.length)).toBe(expectedBeginUrl);
		expect(fieldCollection.url()).toContain("limit=" + BCAPI.Config.Pagination.limit);
		expect(fieldCollection.url()).toContain("skip=" + BCAPI.Config.Pagination.skip);
	});	
	
	it("Test custom field collection fetch ok.", function() {
		var webappName = "Sample webapp",
			rootUrl = "http://test.localhost.com",
			expectedUrl = rootUrl + "/api/v2/admin/sites/current/webapps/" + webappName + "/fields",
			fieldCollection = new BCAPI.Models.WebApp.CustomFieldCollection(webappName),
{'fraction_non_alphanumeric': 0.1400445765230312, 'fraction_numerical': 0.002228826151560178, 'mean_word_length': 5.321596244131455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7551229', 'n_tokens_mistral': 859, 'n_tokens_neox': 782, 'n_words': 148}