summaryrefslogtreecommitdiffstats
path: root/fs/pnode.h
AgeCommit message (Expand)Author
2017-02-04mnt: Tuck mounts under others instead of creating shadow/side mounts.Eric W. Biederman
2016-09-30mnt: Add a per mount namespace limit on the number of mountsEric W. Biederman
2015-07-22mnt: Clarify and correct the disconnect logic in umount_treeEric W. Biederman
2015-04-09mnt: Honor MNT_LOCKED when detaching mountsEric W. Biederman
2015-04-02mnt: Don't propagate unmounts to locked mountsEric W. Biederman
2015-04-02mnt: On an unmount propagate clearing of MNT_LOCKEDEric W. Biederman
2015-04-02mnt: In umount_tree reuse mnt_list instead of mnt_hashEric W. Biederman
2015-04-02mnt: Improve the umount_tree flagsEric W. Biederman
2014-04-01smarter propagate_mnt()Al Viro
2014-03-30switch mnt_hash to hlistAl Viro
2013-08-26vfs: Don't copy mount bind mounts of /proc/<pid>/ns/mnt between namespacesEric W. Biederman
2013-05-01Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir...Linus Torvalds
2013-04-09switch unlock_mount() to namespace_unlock(), convert all umount_tree() callersAl Viro
2013-04-09get rid of full-hash scan on detaching vfsmountsAl Viro
2013-03-27vfs: Carefully propogate mounts across user namespacesEric W. Biederman
2012-11-19vfs: Only support slave subtrees across different user namespacesEric W. Biederman
2012-01-03vfs: switch pnode.h macros to struct mount *Al Viro
2012-01-03vfs: spread struct mount - remaining argument of mnt_set_mountpoint()Al Viro
2012-01-03vfs: spread struct mount - propagate_mnt()Al Viro
2012-01-03vfs: spread struct mount - get_dominating_id / do_make_slaveAl Viro
2012-01-03vfs: spread struct mount - work with countersAl Viro
2012-01-03vfs: spread struct mount - is_path_reachableAl Viro
2012-01-03vfs: spread struct mount - do_umount/propagate_mount_busyAl Viro
2012-01-03vfs: spread struct mount mnt_set_mountpoint child argumentAl Viro
2012-01-03vfs: spread struct mount - clone_mnt/copy_tree argumentAl Viro
2012-01-03vfs: spread struct mount - umount_tree argumentAl Viro
2012-01-03vfs: spread struct mount - clone_mnt/copy_tree resultAl Viro
2012-01-03vfs: spread struct mount - change_mnt_propagation/set_mnt_sharedAl Viro
2012-01-03vfs: spread struct mount - mount group id handlingAl Viro
2012-01-03vfs: add missing parens in pnode.h macrosAl Viro
2012-01-03vfs: more mnt_parent cleanupsAl Viro
2012-01-03vfs: new internal helper: mnt_has_parent(mnt)Al Viro
2012-01-03trim fs/internal.hAl Viro
2010-03-03VFS: Clean up shared mount flag propagationValerie Aurora
2010-03-03Kill CL_PROPAGATION, sanitize fs/pnode.c:get_source()Al Viro
2008-04-23[patch 7/7] vfs: mountinfo: show dominating group idMiklos Szeredi
2008-04-21[PATCH] teach seq_file to discard entriesAl Viro
2007-10-21[PATCH] new helpers - collect_mounts() and release_collected_mounts()Al Viro
2006-12-08[PATCH] rename struct namespace to struct mnt_namespaceKirill Korotaev
2005-11-07[PATCH] unbindable mountsRam Pai
2005-11-07[PATCH] introduce slave mountsRam Pai
2005-11-07[PATCH] shared mounts handling: umountRam Pai
2005-11-07[PATCH] shared mount handling: bind and rbindRam Pai
2005-11-07[PATCH] introduce shared mountsRam Pai
2005-11-07[PATCH] beginning of the shared-subtree properRam Pai
='#n89'>89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
###

ownCloud - News

@author Bernhard Posselt
@copyright 2012 Bernhard Posselt nukeawhale@gmail.com

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU AFFERO GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU Affero General Public
License along with this library.  If not, see <http://www.gnu.org/licenses/>.

###


describe '_FeedController', ->


	beforeEach module 'News'


	beforeEach inject (@_FeedController, @ActiveFeed, @ShowAll, @FeedType,
		               @StarredCount, @FeedModel, @FolderModel, @FeedBl) =>
		@scope =
			$on: ->

		@persistence =
			getItems: ->
				
		@controller = new @_FeedController(@scope, @FolderModel, @FeedModel,
			                               @ActiveFeed, @ShowAll, @FeedType,
			                               @StarredCount, @persistence,
			                               @FeedBl)


	xit 'should make folders available', =>
		@FolderModel.getAll = jasmine.createSpy('FolderModel')
		new @_FeedController(@scope, @FolderModel, @FeedModel, @_ActiveFeed)

		expect(@FolderModel.getAll).toHaveBeenCalled()


	xit 'should make feeds availabe', =>
		@FeedModel.getAll = jasmine.createSpy('FeedModel')
		new @_FeedController(@scope, @FolderModel, @FeedModel, @_ActiveFeed)

		expect(@FeedModel.getAll).toHaveBeenCalled()


	xit 'should make feedtype available', =>
		expect(@scope.feedType).toBe(@FeedType)


	xit 'should check the active feed', =>
		@ActiveFeed.getType = =>
			return @FeedType.Feed
		@ActiveFeed.getId = =>
			return 5

		expect(@scope.isFeedActive(@FeedType.Feed, 5)).toBeTruthy()


	xit 'should provide ShowAll', =>
		expect(@scope.isShowAll()).toBeFalsy()
		
		@ShowAll.setShowAll(true)
		expect(@scope.isShowAll()).toBeTruthy()


	xit 'should handle show all correctly', =>
		@persistence.userSettingsReadHide = jasmine.createSpy('hide')
		@persistence.userSettingsReadShow = jasmine.createSpy('show')

		@scope.setShowAll(true)
		expect(@ShowAll.getShowAll()).toBeTruthy()
		expect(@persistence.userSettingsReadShow).toHaveBeenCalled()
		expect(@persistence.userSettingsReadHide).not.toHaveBeenCalled()


	xit 'should handle hide all correctly', =>
		@persistence.userSettingsReadHide = jasmine.createSpy('hide')
		@persistence.userSettingsReadShow = jasmine.createSpy('show')

		@scope.setShowAll(false)
		expect(@ShowAll.getShowAll()).toBeFalsy()
		expect(@persistence.userSettingsReadShow).not.toHaveBeenCalled()
		expect(@persistence.userSettingsReadHide).toHaveBeenCalled()


	xit 'should get the correct count for starred items', =>
		@StarredCount.setStarredCount(133)
		count = @scope.getUnreadCount(@FeedType.Starred, 0)

		expect(count).toBe(133)


	xit 'should set the count to 999+ if the count is over 999', =>
		@StarredCount.setStarredCount(1000)
		count = @scope.getUnreadCount(@FeedType.Starred, 0)

		expect(count).toBe('999+')





	xit 'should set active feed to new feed if changed', =>
		@ActiveFeed.handle({id: 3, type: 3})
		@scope.loadFeed(4, 3)

		expect(@ActiveFeed.getId()).toBe(3)
		expect(@ActiveFeed.getType()).toBe(4)


	xit 'should return true when calling isShown and there are feeds', =>
		@FeedModel.add({id: 3})
		@ShowAll.setShowAll(true)
		expect(@scope.isShown(3, 4)).toBeTruthy()

		@ShowAll.setShowAll(false)
		expect(@scope.isShown(3, 4)).toBeFalsy()


	xit 'should return true if ShowAll is false but unreadcount is not 0', =>
		@ShowAll.setShowAll(false)
		@FeedModel.add({id: 4, unreadCount: 0, urlHash: 'a1'})
		expect(@scope.isShown(@FeedType.Feed, 4)).toBeFalsy()

		@FeedModel.add({id: 4, unreadCount: 12, urlHash: 'a2'})
		expect(@scope.isShown(@FeedType.Feed, 4)).toBeTruthy()


	xit 'isAddingFolder should return false in the beginning', =>
		expect(@scope.isAddingFolder()).toBeFalsy()


	xit 'isAddingFeed should return false in the beginning', =>
		expect(@scope.isAddingFeed()).toBeFalsy()


	xit 'should not add folders that have no name', =>
		@persistence.createFolder = jasmine.createSpy('create')
		@scope.addFolder(' ')

		expect(@scope.folderEmptyError).toBeTruthy()
		expect(@persistence.createFolder).not.toHaveBeenCalled()


	xit 'should not add folders that already exist client side', =>
		@FolderModel.add({id: 3, name: 'ola'})
		@persistence.createFolder = jasmine.createSpy('create')
		@scope.addFolder(' Ola')

		expect(@scope.folderExistsError).toBeTruthy()
		expect(@persistence.createFolder).not.toHaveBeenCalled()


	xit 'should set isAddingFolder to true if there were no problems', =>
		@persistence.createFolder = jasmine.createSpy('create')
		@scope.addFolder(' Ola')
		expect(@scope.isAddingFolder()).toBeTruthy()


	xit 'should create a create new folder request if everything was ok', =>
		@persistence.createFolder = jasmine.createSpy('create')
		@scope.addFolder(' Ola')
		expect(@persistence.createFolder).toHaveBeenCalled()
		expect(@persistence.createFolder.argsForCall[0][0]).toBe('Ola')
		expect(@persistence.createFolder.argsForCall[0][1]).toBe(0)


	xit 'should should reset the foldername on and set isAddingFolder to false',=>
		@persistence.createFolder =
			jasmine.createSpy('create').andCallFake (arg1, arg2, func) =>
				func()
		@scope.addFolder(' Ola')

		expect(@scope.folderName).toBe('')
		expect(@scope.isAddingFolder()).toBeFalsy()
		expect(@scope.addNewFolder).toBeFalsy()


	xit 'should not add feeds that have no url', =>
		@persistence.createFeed = jasmine.createSpy('create')
		@scope.addFeed(' ')

		expect(@scope.feedEmptyError).toBeTruthy()
		expect(@persistence.createFeed).not.toHaveBeenCalled()


	xit 'should set isAddingFeed to true if there were no problems', =>
		@persistence.createFeed = jasmine.createSpy('create')
		@scope.addFeed('ola')
		expect(@scope.isAddingFeed()).toBeTruthy()


	xit 'should should reset the feedurl and set isAddingFeed to false on succ',=>
		@persistence.createFeed =
			jasmine.createSpy('create').andCallFake (arg1, arg2, func) =>
				data =
					status: 'success'
				func(data)
		@scope.addFeed(' Ola')

		expect(@scope.feedUrl).toBe('')
		expect(@scope.isAddingFeed()).toBeFalsy()


	xit 'should should set isAddingFeed to false on err',=>
		@persistence.createFeed =
			jasmine.createSpy('create').andCallFake (arg1, arg2, func, err) =>
				err()
		@scope.addFeed('Ola')

		expect(@scope.isAddingFeed()).toBeFalsy()
		expect(@scope.feedError).toBeTruthy()


	xit 'should should set isAddingFeed to false on serverside error',=>
		@persistence.createFeed =
			jasmine.createSpy('create').andCallFake (arg1, arg2, func) =>
				data =
					status: 'error'
				func(data)
		@scope.addFeed('Ola')

		expect(@scope.isAddingFeed()).toBeFalsy()
		expect(@scope.feedError).toBeTruthy()


	xit 'should create a create new feed request if everything was ok', =>
		@persistence.createFeed = jasmine.createSpy('create')
		@scope.addFeed('Ola')
		expect(@persistence.createFeed).toHaveBeenCalled()
		expect(@persistence.createFeed.argsForCall[0][0]).toBe('Ola')
		expect(@persistence.createFeed.argsForCall[0][1]).toBe(0)