[Pkg-owncloud-commits] [owncloud] 04/58: Added unit test for reshare by share owner

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 15:58:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.6
in repository owncloud.

commit 59bf55ca7bd3c99891e4b629010c592374c55693
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Apr 22 10:15:59 2015 +0200

    Added unit test for reshare by share owner
    
    Conflicts:
    	core/js/tests/specs/shareSpec.js
---
 core/js/tests/specs/shareSpec.js | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 90cc771..ffde885 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -26,6 +26,7 @@ describe('OC.Share tests', function() {
 		var oldAppConfig;
 		var loadItemStub;
 		var autocompleteStub;
+		var oldCurrentUser;
 
 		beforeEach(function() {
 			$('#testArea').append($('<div id="shareContainer"></div>'));
@@ -54,8 +55,13 @@ describe('OC.Share tests', function() {
 				var $el = $('<div></div>').data('ui-autocomplete', {});
 				return $el;
 			});
+
+
+			oldCurrentUser = OC.currentUser;
+			OC.currentUser = 'user0';
 		});
 		afterEach(function() {
+			OC.currentUser = oldCurrentUser;
 			/* jshint camelcase:false */
 			oc_appconfig.core = oldAppConfig;
 			loadItemStub.restore();
@@ -683,6 +689,26 @@ describe('OC.Share tests', function() {
 					);
 					expect($('#dropdown #shareWithList').length).toEqual(0);
 				});
+				it('allows owner to share their own share when they are also the recipient', function() {
+					OC.currentUser = 'user1';
+					loadItemStub.returns({
+						reshare: {
+							permissions: OC.PERMISSION_READ,
+							uid_owner: 'user1'
+						},
+						shares: []
+					});
+					OC.Share.showDropDown(
+						'file',
+						123,
+						$container,
+						true,
+						OC.PERMISSION_ALL,
+						'shared_file_name.txt'
+					);
+					// sharing still allowed
+					expect($('#dropdown #shareWithList').length).toEqual(1);
+				});
 			});
 		});
 	});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list