summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-04-22 10:15:59 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-04-29 10:34:37 +0200
commit93cf51389aba464c13324f82e444bdb0e121ed31 (patch)
treef3f77ce578c146427f2cf6252a80170281a1723f
parent4d53706d4ce3eaa03342c78be3462f52a6fac400 (diff)
downloadnextcloud-server-93cf51389aba464c13324f82e444bdb0e121ed31.tar.gz
nextcloud-server-93cf51389aba464c13324f82e444bdb0e121ed31.zip
Added unit test for reshare by share owner
-rw-r--r--core/js/tests/specs/shareSpec.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index a16358b55c5..3e9a0b247d7 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -29,6 +29,7 @@ describe('OC.Share tests', function() {
var oldEnableAvatars;
var avatarStub;
var placeholderStub;
+ var oldCurrentUser;
beforeEach(function() {
$('#testArea').append($('<div id="shareContainer"></div>'));
@@ -62,8 +63,12 @@ describe('OC.Share tests', function() {
oc_config.enable_avatars = false;
avatarStub = sinon.stub($.fn, 'avatar');
placeholderStub = sinon.stub($.fn, 'imageplaceholder');
+
+ oldCurrentUser = OC.currentUser;
+ OC.currentUser = 'user0';
});
afterEach(function() {
+ OC.currentUser = oldCurrentUser;
/* jshint camelcase:false */
oc_appconfig.core = oldAppConfig;
loadItemStub.restore();
@@ -864,6 +869,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);
+ });
});
});
});