summaryrefslogtreecommitdiff
path: root/spec/models/project_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use a query in Project#protected_branch?Yorick Peterse2016-04-291-0/+14
| | | | | | This changes Project#protected_branch? to use a query to check if a branch is protected, instead of loading all ProtectedBranch records into memory just to check if the list of names includes a given branch name.
* Fix Error 500 due to stale cache when projects are renamed or transferredStan Hu2016-04-251-5/+2
| | | | Closes gitlab-org/gitlab-ee#506
* Write specs for this featureKamil Trzcinski2016-04-161-1/+14
|
* Fix specsKamil Trzcinski2016-04-111-2/+2
|
* Exclude projects pending deletion from all resultsZeger-Jan van de Weg2016-03-311-0/+9
|
* Don't attempt to look up an avatar in repo if repo directory does not existStan Hu2016-03-251-0/+6
| | | | Closes #14580
* Address feedbackDouwe Maan2016-03-221-2/+2
|
* Merge branch 'master' into issue_12658Douwe Maan2016-03-211-0/+41
|\ | | | | | | | | | | | | | | | | # Conflicts: # app/models/issue.rb # app/views/projects/_home_panel.html.haml # app/views/shared/projects/_project.html.haml # db/schema.rb # spec/models/project_spec.rb
| * Cache output of Repository#exists?Yorick Peterse2016-03-191-0/+41
| | | | | | | | | | | | | | | | | | This caches the output of Repository#exists? in Redis while making sure it's flushed properly when creating new repositories, deleting them, etc. For the ProjectWiki tests to work I had to make ProjectWiki#create_repo! public as testing private methods in RSpec is a bit of a pain.
* | Fix specsFelipe Artur2016-03-181-1/+1
| |
* | Improve group visibility level featureZeger-Jan van de Weg2016-03-181-6/+2
| |
* | Merge 4009-external-users into issue_12658Felipe Artur2016-03-161-11/+85
|\ \ | |/
| * Ignore eager loading in Project.search UNIONYorick Peterse2016-03-151-0/+6
| | | | | | | | | | | | | | | | | | | | The queries that are UNION'd together don't need any eager loading (since we really only use the resulting SQL instead of having ActiveRecord actually run the queries). By dropping any eager loaded associations queries such as the following work instead of producing a SQL error: Project.all.includes(:namespace).search('foo')
| * Use ILIKE in Project.search_by_titleYorick Peterse2016-03-111-0/+16
| | | | | | | | | | | | Similar to the changes made to Project.search the method Project.search_by_title now also uses Arel so it can automatically use ILIKE/LIKE instead of the lower() function.
| * Use ILIKE/LIKE + UNION in Project.searchYorick Peterse2016-03-111-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This chance is broken up in two steps: 1. Use ILIKE on PostgreSQL and LIKE on MySQL, instead of using "WHERE lower(x) LIKE lower(y)" as ILIKE is significantly faster than using lower(). In many cases the use of lower() will force a slow sequence scan. 2. Instead of using 1 query that searches both projects and namespaces using a JOIN we're using 2 separate queries that are UNION'd together. Using a JOIN would force a slow sequence scan, using a UNION avoids this. This method now uses Arel as Arel automatically uses ILIKE on PostgreSQL and LIKE on MySQL, removing the need to handle this manually.
* | Prevent projects to have higher visibility than groupsFelipe Artur2016-03-101-0/+15
|/ | | | | | Prevent Groups to have smaller visibility than projects Add default_group_visibility_level to configuration Code improvements
* Destroy all related todos when removing a projectDouglas Barbosa Alexandre2016-03-091-0/+1
|
* Make better use of the `visibility_level` factory traitsrs-traits-are-goodRobert Speicher2016-03-081-1/+1
|
* Flush repository caches before renaming projectsrenaming-repository-cachingYorick Peterse2016-02-261-7/+70
| | | | | | | | This ensures that if a project is later re-created using the old path it doesn't end up re-using the old cache. This also ensures we don't keep the cache around until its expired by Redis itself. Fixes gitlab-org/gitlab-ce#13790
* Fix old usages of `ci_runner` factoryTomasz Maczukin2016-02-191-2/+2
|
* Annotate modelsStan Hu2016-01-061-0/+7
|
* Add some specs for forked project visibility_level casesTomasz Maczukin2015-12-241-0/+24
|
* Merge branch 'add-open-issues-count-to-api' of ↵Dmitriy Zaporozhets2015-12-161-1/+5
|\ | | | | | | | | | | https://gitlab.com/stanhu/gitlab-ce Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Add open_issues_count to project APIStan Hu2015-12-111-1/+5
| | | | | | | | This is needed to support Huboard and a generally useful value.
* | Fix after column renameKamil Trzcinski2015-12-111-4/+4
| |
* | Remove ci_ prefix from all ci related thingsKamil Trzcinski2015-12-111-8/+8
| |
* | Add runners tokenKamil Trzcinski2015-12-111-1/+1
| |
* | Migrate CI::Project to ProjectKamil Trzcinski2015-12-111-8/+81
|/
* Tag model specsDouwe Maan2015-12-091-1/+1
|
* Update annotationsStan Hu2015-12-081-0/+1
|
* Fix broken spec related to MySQL and fractional seconds support.Rubén Dávila2015-12-031-1/+3
|
* Merge branch 'emoji_votes' into 'master' Dmitriy Zaporozhets2015-11-191-11/+0
|\ | | | | | | | | | | | | | | | | | | Award Emoji This it first iteration of award emoji feature. We have plan to extend emoji picker by the next release. For now, you can add award by clicking to the emoji picker or posting a regular comment with emoji like ":+1:" and any other. You can post not only emoji that listed in the emoji picker. See merge request !1825
| * award emojiValery Sizov2015-11-191-11/+0
| |
* | Added Project.visible_to_userYorick Peterse2015-11-181-0/+19
|/ | | | | This method can be used to filter projects to those visible to a given user.
* Expose CI enable option in project featuresKamil Trzcinski2015-11-131-3/+6
| | | | - Enable CI by default for all new projects
* Revamp trending projects queryYorick Peterse2015-10-061-0/+38
| | | | | | | | | | | | | | | | This changes the query to use a COUNT nested in an INNER JOIN, instead of a COUNT plus a GROUP BY. There are two reasons for this: 1. Using a COUNT in an INNER JOIN can be quite a bit faster. 2. The use of a GROUP BY means that method calls such as "any?" (and everything else that calls "count") operate on a Hash that counts the amount of notes on a per project basis, instead of just counting the total amount of projects. The query has been moved into Project.trending as its logic is simple enough. As a result of this testing the TrendingProjectsFinder class simply involves testing if the right methods are called, removing the need for setting up database records.
* Merge remote-tracking branch 'upstream/master'Guilherme Garnier2015-10-031-2/+1
|\
| * Prevent creating 2 Ci::Project entities when enable CIDmitriy Zaporozhets2015-10-021-2/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Fix rubocop warnings in spec/modelsGuilherme Garnier2015-10-031-1/+1
|/
* Merge branch 'master' into flevour/gitlab-ce-project-path-insensitive-lookupDouwe Maan2015-10-011-0/+22
|\
| * Make ensure_gitlab_ci_project return ci_project or create a new oneci-commits-to-projectsKamil Trzcinski2015-09-291-1/+1
| |
| * Fix testsKamil Trzcinski2015-09-291-3/+5
| |
| * Enable CI for gitlab when .gitlab-ci.yml is pushedDmitriy Zaporozhets2015-09-231-0/+10
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Show CI status on all pages where commits list is renderedDmitriy Zaporozhets2015-09-231-0/+10
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Make Project#find_with_namespace case-insensitiveFrancesco Levorato2015-09-181-0/+1
|/
* Revert "Merge branch 'revert-satellites' into 'master' "Dmitriy Zaporozhets2015-08-111-1/+0
| | | | | This reverts commit 5daf44b7c86e0e2641a902b1da8b01d91fa3dbfa, reversing changes made to 2f706fbd231cabe7a76a5d17ac44285aaaf8592c.
* Revert "Merge branch 'drop-satellites'"Dmitriy Zaporozhets2015-08-111-0/+1
| | | | | | | This reverts commit 957e849f41d96fa9778fcdd06792d2f0274b29ab, reversing changes made to 6b9dbe9f5a175a8162abf296367f561bab3eea1a. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'master' into drop-satellitesDmitriy Zaporozhets2015-08-041-7/+14
|\ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Re-annotate modelsAtsushi Ishida2015-08-031-1/+2
| |
| * Fix specsDouwe Maan2015-07-291-6/+12
| |