summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'issue_subscription' into 'master'Dmitriy Zaporozhets2015-03-171-0/+32
|\ | | | | | | | | | | | | | | | | | | | | | | Subscription to issue/mr Fixes #1911 and #1909 ![joxi_screenshot_1426601822159](https://dev.gitlab.org/gitlab/gitlabhq/uploads/53021bc5783271322ab2dfba7598eaa3/joxi_screenshot_1426601822159.png) ![joxi_screenshot_1426601836423](https://dev.gitlab.org/gitlab/gitlabhq/uploads/244ff360fbd6f30980f8dad699400814/joxi_screenshot_1426601836423.png) See merge request !1702
| * testsValery Sizov2015-03-161-0/+32
| |
* | Merge branch 'fix-restricted-visibility' into 'master'Dmitriy Zaporozhets2015-03-164-3/+126
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restricted visibility levels - bug fix and new feature This allows admin users to override restricted visibility settings when creating and updating projects and snippets, and moves the restricted visibility configuration from gitlab.yml to the web UI. See #1903. ## Move configuration location I added a new section to the application settings page for restricted visibility levels. Each level has a checkbox, styled with Bootstrap to look like a toggle button. A checked box means that the level is restricted. I added a glowing text shadow and changed the background color for checked buttons because the default styles made it hard to distinguish between checked and unchecked. This image shows the new section with the "Public" box checked: ![restricted_visibility_settings](https://dev.gitlab.org/Okada/gitlabhq/uploads/629562e4313f89b795e81c3bb0f95893/restricted_visibility_settings.png) ## Allow admins to override To allow admin users to override the restricted visibility levels, I had to remove the `visibility_level` validation from the `Project` class. The model doesn't know about the `current_user`, which should determine whether the restrictions can be overridden. We could use the creator in the validation, but that wouldn't work correctly for projects where a non-admin user is the creator and an admin tries to change the project to a restricted visibility level. The `Project::UpdateService` and `Project::CreateService` classes already had code to determine whether the current user is allowed to use a given visibility level; now all visibility level validation is done in those classes. Currently, when a non-admin tries to create or update a project using a restricted level, these classes silently set the visibility level to the global default (create) or the project's existing value (update). I changed this behavior to be more like an Active Model validation, where using a restricted level causes the entire request to be rejected. Project and personal snippets didn't have service classes, and restricted visibility levels weren't being enforced in the model or the controllers. The UI disabled radio buttons for restricted levels, but that wouldn't be difficult to circumvent. I created the `CreateSnippetService` and `UpdateSnippetService` classes to do the same restricted visibility check that the project classes do. And since I was dealing with snippet visibility levels, I updated the API endpoints for project snippets to allow users to set and update the visibility level. ## TODO * [x] Add more tests for restricted visibility functionality cc @sytse @dzaporozhets See merge request !1655
| * \ Merge branch 'master' into fix-restricted-visibilityVinnie Okada2015-03-141-9/+0
| |\ \ | | |/ | | | | | | | | | Conflicts: db/schema.rb
| * | Add tests for snippet servicesVinnie Okada2015-03-142-0/+96
| | | | | | | | | | | | | | | Add Rspec tests for the new UpdateSnippetService and CreateSnippetService classes.
| * | Allow admins to override restricted visibilityVinnie Okada2015-03-082-3/+30
| | | | | | | | | | | | | | | Allow admins to use restricted visibility levels when creating or updating projects.
* | | Use `group_member` instead of `users_group` or `membership`.Douwe Maan2015-03-151-3/+3
| |/ |/|
* | fix mass SQL statements on initial pushHannes Rosenögger2015-03-091-9/+0
|/ | | | | | | This commit disables process_commit_messages() for the initial push to the default branch. This fixes the mass SQL statements (~500000) that were executed during the initial push of the linux kernel for example.
* Merge branch 'mass-change-comments' into 'master'Dmitriy Zaporozhets2015-03-071-18/+10
|\ | | | | | | | | | | | | | | Send notifications and leave system comments when bulk updating issues. Resolves https://dev.gitlab.org/gitlab/gitlabhq/issues/1885. See merge request !1646
| * Send notifications and leave system comments when bulk updating issues.Douwe Maan2015-03-061-18/+10
| |
* | Condense commits already in target branch when updating merge request source ↵Douwe Maan2015-03-061-1/+1
|/ | | | branch.
* Issue #595: Support Slack notifications upon issue and merge request eventsStan Hu2015-03-031-0/+1
| | | | | | | | | | | 1) Adds a DB migration for all services to toggle on push, issue, and merge events. 2) Upon an issue or merge request event, fire service hooks. 3) Slack service supports custom messages for each of these events. Other services not supported at the moment. 4) Label merge request hooks with their corresponding actions.
* Allow mass-unassigning of issuesRobert Speicher2015-02-251-0/+19
| | | | | | Fixes #867 [ci skip]
* Rename bulk_update_context_spec to bulk_update_service_specRobert Speicher2015-02-251-0/+0
|
* Merge branch 'master' into extend_markdown_uploadDouwe Maan2015-02-242-4/+14
|\ | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # app/views/projects/issues/_form.html.haml # app/views/projects/merge_requests/_form.html.haml # app/views/projects/merge_requests/_new_submit.html.haml # app/views/projects/milestones/_form.html.haml # app/views/projects/notes/_form.html.haml # app/views/projects/wikis/_form.html.haml # config/routes.rb # spec/controllers/projects_controller_spec.rb
| * Upgrade to Rails 4.1.9Vinnie Okada2015-02-142-4/+14
| | | | | | | | | | | | Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers.
* | Refactor.Douwe Maan2015-02-171-13/+7
| |
* | implement Project::UploadsControllerHannes Rosenögger2015-02-171-4/+4
| |
* | Fix testsHannes Rosenögger2015-02-171-4/+4
| |
* | Generalize the image upload in markdownHannes Rosenögger2015-02-172-62/+81
|/ | | | | This commit generalizes the image upload via drag and drop so it supports all files. It also adds access control for these files.
* Updated rspec to rspec 3.x syntaxJeroen van Baarsen2015-02-1222-264/+266
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Add labels notesNikita Verkhovin2015-02-082-2/+20
|
* Add test for default branch protection configurationMarco Wessel2015-01-311-0/+18
|
* Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵Marco Wessel2015-01-304-1/+40
|\ | | | | | | | | | | | | | | configure-protection Conflicts: CHANGELOG db/schema.rb
| * Merge pull request #8652 from bladealslayer/feature/system_hook_for_groupsDmitriy Zaporozhets2015-01-271-0/+31
| |\ | | | | | | Added support for firing system hooks on group create/destroy and adding...
| | * Added support for firing system hooks on group create/destroy and ↵Boyan Tabakov2015-01-271-0/+31
| | | | | | | | | | | | | | | | | | adding/removing users to group. Added tests and updated docs. Also adding 'user_id' field in the hooks for adding/removing user from team.
| * | Remove unnecessary reload in testDmitriy Zaporozhets2015-01-261-1/+1
| | |
| * | Organize event order execution when update issue or mrDmitriy Zaporozhets2015-01-252-1/+4
| | |
| * | Add issue/mr participants to reasign eventsDmitriy Zaporozhets2015-01-251-1/+6
| |/ | | | | | | Also refactor NotificationService a bit
* | Allow configuring protection of the default branch upon first pushMarco Wessel2015-01-251-1/+1
|/
* Add action property to merge request hookjubianchi2015-01-205-12/+129
|
* Improve mr refresh service testsDmitriy Zaporozhets2015-01-061-4/+4
|
* New feature: add 'Mention' notification levelDmitriy Zaporozhets2014-12-291-1/+15
| | | | | | It does disable all emails expect system one or when you was @mentioned Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'prepare-fork-to-given-namespace' of ↵Dmitriy Zaporozhets2014-11-131-4/+48
|\ | | | | | | https://gitlab.com/bkaindl/gitlab-ce into bkaindl/gitlab-ce-prepare-fork-to-given-namespace
| * Prepare ForkService to support forking projects to given namespacesBernhard Kaindl2014-10-031-4/+48
| | | | | | | | | | | | | | Remove overload of BaseService.initialize, so initialize gains params, which is used to pass the namespace (like e.g. in TransferService). The namespace is checked for permission to create projects in it.
* | Refactor merge request refresh logic on pushDmitriy Zaporozhets2014-11-111-0/+98
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Factor '0' * 40 blank ref constantsCiro Santilli2014-11-031-1/+1
| |
* | transfer_service_spec: cleanup, merge common code, check against nilBernhard Kaindl2014-10-041-11/+9
|/ | | | | | | | - replace creation of group2 with the use of group without add_owner(user) - fold TransferService calls into new test function transfer_project - remove currently not used (and not working) gitlab_shell stub (will submit testcase simulating failure in gitlab_shell separately) - add checks against not be_nil (result.should be_false passes even if nil)
* Add a simple spec test.Marin Jankovski2014-09-291-0/+2
|
* Improve git_push service specsDmitriy Zaporozhets2014-09-261-0/+26
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Fix adminarea and emails for new membership logicDmitriy Zaporozhets2014-09-151-5/+5
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Huge replace of old users_project and users_group referencesDmitriy Zaporozhets2014-09-141-3/+3
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Add system hook for ssh key changesLukas Erlacher2014-09-031-0/+5
| | | | | | Add system hook for ssh key create and destroy Update and fix documentation Update tests
* block visibility level restriction override in controllerJob van der Voort2014-08-281-1/+1
|
* Fix testsDmitriy Zaporozhets2014-08-271-4/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Prevent project stars duplication when fork projectDmitriy Zaporozhets2014-08-251-14/+9
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Fix git_push service specsDmitriy Zaporozhets2014-08-011-2/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Test if reopen notifications are sent.Marin Jankovski2014-07-031-0/+38
|
* Fix tests because previous assignee didn't exist.Marin Jankovski2014-07-021-2/+2
|
* Merge branch 'group_milestones' into 'master'Dmitriy Zaporozhets2014-07-011-0/+70
|\ | | | | | | Group milestones