summaryrefslogtreecommitdiff
path: root/spec/models/issue_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Prefer leading style for Style/DotPositionDouwe Maan2017-02-231-4/+4
|
* Present group and dashboard MR list without grouping by projectOswaldo Ferreira2017-01-271-4/+4
|
* Refactor Project#to_reference and make full_path a keyword argumentBerna Castro2017-01-271-11/+55
| | | | | | | | | | | | Refactor overall code and fix failing specs Fix Project#to_reference Fix wrong spaces and update changelog Refactor #to_reference for Project & Issue Fix and improves Project#to_reference
* Fix and add specs for Issue#to_referenceBerna Castro2017-01-271-1/+10
|
* Use `:empty_project` where possible in model specsrs-empty_project-modelsRobert Speicher2017-01-261-9/+9
|
* Use a project factory with a repository where necessaryrs-empty_project-for-associationsRobert Speicher2017-01-251-1/+1
|
* Fix cross-project references copy to include the project referencefix/cross-project-ref-pathJames Lopez2017-01-031-0/+4
| | | | Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
* Merge branch 'jej-24637-move-issue-visible_to_user-to-finder' into 'security' Sean McGivern2016-12-151-20/+0
| | | | | | | Issue#visible_to_user moved to IssuesFinder Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24637. See merge request !2039
* Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-021-4/+6
|
* Drop Project#authorized_for_user? in favor of ProjectTeam#member?Ahmad Sherif2016-11-231-1/+1
| | | | Closes #23938
* Merge branch 'issue_23548_dev' into 'master'Douwe Maan2016-11-091-40/+56
| | | | | | | | | | | | | | | | | | | | | disable markdown in comments when referencing disabled features fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548 This MR prevents the following references when tool is disabled: - issues - snippets - commits - when repo is disabled - commit range - when repo is disabled - milestones This MR does not prevent references to repository files, since they are just markdown links and don't leak information. See merge request !2011 Signed-off-by: Rémy Coutable <remy@rymai.me>
* Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests ↵14192-issues-closed-by-merge-requests-using-metrics-dataPaco Guzman2016-10-201-1/+7
| | | | method
* Allow Member.add_user to handle access requestersRémy Coutable2016-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Changes include: - Ensure Member.add_user is not called directly when not necessary - New GroupMember.add_users_to_group to have the same abstraction level as for Project - Refactor Member.add_user to take a source instead of an array of members - Fix Rubocop offenses - Always use Project#add_user instead of project.team.add_user - Factorize users addition as members in Member.add_users_to_source - Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects - Destroy any requester before adding them as a member - Improve the way we handle access requesters in Member.add_user Instead of removing the requester and creating a new member, we now simply accepts their access request. This way, they will receive a "access request granted" email. - Fix error that was previously silently ignored - Stop raising when access level is invalid in Member, let Rails validation do their work Signed-off-by: Rémy Coutable <remy@rymai.me>
* Method for returning issues readable by a userability-batch-issue-checkingYorick Peterse2016-07-291-0/+253
| | | | | | | | | | | | | The method Ability.issues_readable_by_user takes a list of users and an optional user and returns an Array of issues readable by said user. This method in turn is used by Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this method no longer needs to get all the available abilities just to check if a user has the "read_issue" ability. To test this I benchmarked an issue with 222 comments on my development environment. Using these changes the time spent in nodes_visible_to_user was reduced from around 120 ms to around 40 ms.
* Refactor user authorization check for a single project to avoid querying all ↵Alejandro Rodríguez2016-07-201-0/+20
| | | | | | | | | | user projects Currently, even when searching for all authorized issues of *one* project, we run the `Users#authorized_projects` query (which can be rather slow). This update checks if we are handling issues of just one project and does the authorization check locally. It does have the downside of basically repeating the logic of `Users#authorized_projects` on `Project#authorized_for_user`.
* Update specs. Add CHANGELOG entryissue-18036Josh Frye2016-06-021-0/+17
|
* Refactor ParticipableYorick Peterse2016-06-011-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several changes to this module: 1. The use of an explicit stack in Participable#participants 2. Proc behaviour has been changed 3. Batch permissions checking == Explicit Stack Participable#participants no longer uses recursion to process "self" and all child objects, instead it uses an Array and processes objects in breadth-first order. This allows us to for example create a single Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using a ReferenceExtractor removes the need for running potentially many SQL queries every time a Proc is called on a new object. == Proc Behaviour Changed Previously a Proc in Participable was expected to return an Array of User instances. This has been changed and instead it's now expected that a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return value of the Proc is ignored. == Permissions Checking The method Participable#participants uses Ability.users_that_can_read_project to check if the returned users have access to the project of "self" _without_ running multiple SQL queries for every user.
* Enable RSpec/NotToNot cop and auto-correct offensesrs-rubocop-nottonotRobert Speicher2016-05-241-1/+1
| | | | Also removes the note from the development/testing.md guide
* Remove the annotate gem and delete old annotationsJeroen van Baarsen2016-05-091-20/+0
| | | | | | | | | In 8278b763d96ef10c6494409b18b7eb541463af29 the default behaviour of annotation has changes, which was causing a lot of noise in diffs. We decided in #17382 that it is better to get rid of the whole annotate gem, and instead let people look at schema.rb for the columns in a table. Fixes: #17382
* A new branch created for a confidential issue is named ↵14566-confidential-issue-branchesTimothy Andrew2016-04-191-1/+1
| | | | `<id>-confidential-issue`.
* Merge remote-tracking branch 'origin/master' into ↵Timothy Andrew2016-04-151-6/+13
|\ | | | | | | 14566-confidential-issue-branches
| * Start with iid on branch creationZeger-Jan van de Weg2016-04-141-5/+12
| |
* | Make a few style changes based on MR feedback.Timothy Andrew2016-04-151-2/+2
| |
* | Fix the rubocop check.Timothy Andrew2016-04-131-2/+3
| |
* | Test the `Issue#to_branch_name` method.Timothy Andrew2016-04-121-2/+11
| |
* | Augment the tests for `Issue#related_branches`Timothy Andrew2016-04-121-3/+19
| | | | | | | | | | | | | | - Test the case where we have a referenced merge request that's being - excluded as a "related branch" - This took a while to figure out, especially the `create_cross_references!` line.
* | Refactor `Issue#related_branches`Timothy Andrew2016-04-121-1/+2
|/ | | | | | | | | | | | | | | | | - Previously, the controller held the logic to calculate related branches, which was: `<branches ending with `issue.iid`> - <branches with a merge request referenced in the current issue>` - This logic belongs in the `related_branches` method, not in the controller. This commit makes this change. - This means that `Issue#related_branches` now needs to take a `User`. When we find the branches that have a merge request referenced in the current issue, this is limited to merge requests that the current user has access to. - This is not directly related to #14566, but is a related refactoring.
* Do not allow to move issue if it has not been persistedmove-issue-section-should-not-be-displayed-in-the-new-issue-form-14489Grzegorz Bizon2016-03-231-0/+5
|
* Merge branch 'master' into 2489-soft-delete-issuesZeger-Jan van de Weg2016-03-211-2/+52
|\
| * Merge branch 'issues-show-performance' into 'master' Robert Speicher2016-03-211-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve performance of viewing individual issues This MR does two things: 1. `Issue#related_branches` no longer performs Git operations that aren't needed 2. The output of `Repository#exists?` is now cached and flushed properly Combined these two changes should further cut down the amount of Git operations performed when viewing individual issues (and possibly other pages). See merge request !3296
| | * Tweaked performance of Issue#related_branchesYorick Peterse2016-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Requesting the branch names of a repository works even when it's empty, thus there's no need to explicitly check for an empty repository. Removing this check cuts down the amount of Git operations which in turn cuts down request timings a bit. The regular expression used to compare branches was also moved out of the loop so it's created only once.
| * | Merge branch 'master' into feature/issue-moveGrzegorz Bizon2016-03-201-3/+3
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Fix bug where wrong commit ID was being used in a merge request diff to show old image Remove CHANGELOG item that was added during merge resolution Improve the "easy WIP & un-WIP from link" feature Fix specs \#to_branch_name now uses the iid as postfix Add label description in tooltip to labels in issue index and sidebar Easily (un)mark merge request as WIP using link Use specialized system notes when MR is (un)marked as WIP another attempt to fix oauth issue attempting to fix omniauth problem Conflicts: app/assets/javascripts/issuable_form.js.coffee
| * | Merge branch 'master' into feature/issue-moveGrzegorz Bizon2016-03-191-0/+17
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (121 commits) Dedupe labels in labels selector in Dashboard pages Refactor colors and lists Add a safeguard in MergeRequest#compute_diverged_commits_count Fix an issue when the target branch of a MR had been deleted Add avatar to issue and MR pages header Cleanup somce css colors Re-group scss variables Refactor `Todo#target` Fixes issue with filter label missing on labels & milestones Rename `Todo#to_reference` to `Todo#target_reference` Fixed failing tests Updated controller with before_action Fixed other issues based on feedback Fixes issue on dashboard issues Full labels data in JSON Fixed issue with labels dropdown getting wrong labels Update CHANGELOG Use `Note#for_project_snippet?` to skip notes on project snippet Use `Commit#short_id` instead of `Commit.truncate_sha` Reuse `for_commit?` on conditional validations Update schema info comment on todo related files ... Conflicts: app/models/issue.rb db/schema.rb spec/models/issue_spec.rb
| * | | Prevent issue move if issue has been already movedGrzegorz Bizon2016-03-171-0/+50
| | | |
* | | | Soft delete issuablesZeger-Jan van de Weg2016-03-191-0/+5
| |_|/ |/| |
* | | \#to_branch_name now uses the iid as postfixissue-branch-iid-postfixZeger-Jan van de Weg2016-03-181-3/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Given the branch name 'mep-mep' with an iid being 1, the current way, master's way, would yield a branch name of 1-mep-mep. The problem for larger projects however would be that a developer might forget what iid the issue was. When this developer would try to tab complete it would: - Or result in 20+ branches possibly - Or start with the wrong digit, try again with digit++ - Would see 20 branches, repeat Thus the obvious way of solving this is letting the dev tab complete on the issue title, which is easier to remember.
* | Incorporate reviewZeger-Jan van de Weg2016-03-151-0/+9
| |
* | Enhance new branch button on an issueZeger-Jan van de Weg2016-03-151-4/+0
| |
* | new-branch-buttonZeger-Jan van de Weg2016-03-151-0/+12
|/
* Added specs for Issue#referenced_merge_requestsYorick Peterse2016-03-091-0/+25
|
* Tag model specsDouwe Maan2015-12-091-1/+1
|
* Only accept open issues and merge requestsZeger-Jan van de Weg2015-10-161-0/+37
|
* Fix mentionable specsDouwe Maan2015-10-121-1/+1
|
* Re-annotate modelsStan Hu2015-09-061-13/+14
|
* Use to_reference for issue and merge request mentionable specsRobert Speicher2015-06-221-1/+1
|
* Minor model spec cleanupsRobert Speicher2015-05-261-5/+2
| | | | Snippet model was missing project association
* Add `to_reference` for models that support referencesRobert Speicher2015-05-261-3/+18
| | | | | Now there is a single source of information for which attribute a model uses to be referenced, and its special character.
* Correct usage of `subject` in specsRobert Speicher2015-04-161-1/+2
|
* Updated rspec to rspec 3.x syntaxJeroen van Baarsen2015-02-121-5/+5
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Add specs for tasksVinnie Okada2014-10-051-0/+4
| | | | | Add tests for the new task list functionality in the Markdown parser and in issues and merge requests.