瀏覽代碼

buttonText automated tests, adjust for option system refactor

Adam Shaw 11 年之前
父節點
當前提交
ff2431621a
共有 1 個文件被更改,包括 6 次插入8 次删除
  1. 6 8
      tests/automated/custom-view-duration.js

+ 6 - 8
tests/automated/custom-view-duration.js

@@ -240,12 +240,11 @@ describe('custom view', function() {
 			expect($('.fc-custom-button')).toHaveText('awesome');
 		});
 
-		it('accepts lang\'s defaultButtonText single-unit-match override', function() {
+		it('accepts lang\'s single-unit-match override', function() {
 			options.lang = 'fr';
 			options.views.custom = {
 				type: 'basic',
-				duration: { days: 1 },
-				buttonText: 'awesome'
+				duration: { days: 1 }
 			};
 			options.header = {
 				center: 'custom,month'
@@ -255,11 +254,11 @@ describe('custom view', function() {
 			expect($('.fc-custom-button')).toHaveText('Jour');
 		});
 
-		it('does not accept lang\'s defaultButtonText single-unit-match override when unit>1', function() {
+		it('accepts explicit View-Specific buttonText, overriding lang\'s single-unit-match override', function() {
 			options.lang = 'fr';
 			options.views.custom = {
 				type: 'basic',
-				duration: { days: 2 },
+				duration: { days: 1 },
 				buttonText: 'awesome'
 			};
 			options.header = {
@@ -327,15 +326,14 @@ describe('custom view', function() {
 		});
 
 		it('falls back to view name when view lacks metadata', function() {
-			options.views = {
-				crazy: $.fullCalendar.View.extend()
-			};
+			$.fullCalendar.views.crazy = $.fullCalendar.View.extend();
 			options.header = {
 				center: 'crazy,month'
 			};
 			options.defaultView = 'crazy';
 			$('#cal').fullCalendar(options);
 			expect($('.fc-crazy-button')).toHaveText('crazy');
+			delete $.fullCalendar.views.crazy;
 		});
 	});
 });