summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add ldap_blocked as new state to users state machineGabriel Mazetto2016-01-081-16/+28
|
* Annotate modelsStan Hu2016-01-061-56/+57
|
* Prevent duplicate "username has already been taken" validation messagers-issue-201Robert Speicher2016-01-021-1/+1
| | | | Closes #201 - two-year-old bug, woo! :boom: :tada:
* Merge branch 'add_email_unlock' into 'master' Robert Speicher2015-12-211-0/+1
|\ | | | | | | | | | | | | | | | | | | | | Allow account unlock via email We see a lot of users get confused about what it means when your account gets locked. Many try to reset their password and are still faced with a lockout. With this change, users receive an email that allows them to unlock their account immediately. The previous behavior where the account is auto-unlocked after a time also still works. See merge request !2049
| * Allow account unlock via emailDrew Blessing2015-12-141-0/+1
| |
* | Fixed Rubocop offensesGabriel Mazetto2015-12-151-2/+2
|/
* Tag model specsDouwe Maan2015-12-091-1/+1
|
* Update annotationsStan Hu2015-12-081-0/+1
|
* Add custom NamespaceValidatorRobert Speicher2015-12-071-1/+17
|
* Refactor User#authorized_groups/projectsYorick Peterse2015-11-181-22/+4
| | | | | | | | | | | | | These methods no longer include public groups/projects (that don't belong to the actual user) as this is handled by the various finder classes now. This also removes the need for passing extra arguments. Note that memoizing was removed _explicitly_. For whatever reason doing so messes up the users controller to a point where it claims a certain user does _not_ have access to certain groups/projects when it does have access. Existing code shouldn't be affected as these methods are only called in ways that they'd run queries anyway (e.g. a combination of "any?" and "each" which would run 2 queries regardless of memoizing).
* Refactor getting user groups/projects/contributionsYorick Peterse2015-11-181-4/+48
| | | | | | | | | | | | This new setup no longer loads any IDs into memory using "pluck", instead using SQL UNIONs to merge the various datasets together. This results in greatly improved query performance as well as a reduction of memory usage. The old setup was in particular problematic when requesting the authorized projects _including_ public/internal projects as this would result in roughly 65000 project IDs being loaded into memory. These IDs would in turn be passed to other queries.
* Annotate modelsDmitriy Zaporozhets2015-11-131-0/+2
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Fixed User sorting specsremove-duplicate-ordersYorick Peterse2015-11-031-6/+6
| | | | | The descriptions were not accurate and one particular spec seemingly expected the wrong User row to be returned.
* Merge branch 'rs-throttle-reset' into 'master' Douwe Maan2015-10-021-0/+20
|\ | | | | | | | | | | | | Throttle "Forgot your password?" emails Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2611 See merge request !1476
| * Conform to spec guidelines that only exist in my headrs-throttle-resetRobert Speicher2015-10-021-1/+1
| | | | | | | | [ci skip]
| * Add User#recently_sent_password_reset?Robert Speicher2015-10-011-0/+20
| |
* | Streamline the "Report button"rymai/gitlab-ce-disable-report-button-if-already-reportedRémy Coutable2015-09-291-1/+1
| | | | | | | | | | | | This simplifies the "Report button" to not use open a dropdown and adds a tooltip on this button. This also removes an extra spec and adds missing specs.
* | Disable the "Report abuse" button if a user has already been reportedRémy Coutable2015-09-291-0/+1
|/
* Devise 3.5.x deprecates `confirm!` in favor of `confirm`Robert Speicher2015-09-191-1/+1
|
* Re-annotate modelsStan Hu2015-09-061-56/+52
|
* Only show recent push event if the branch still exists or a recent merge ↵Stan Hu2015-08-201-0/+29
| | | | | | request has not been created Closes #2277
* Add "Confirm user" button in user admin pageStan Hu2015-08-051-0/+13
| | | | | Closes #2116 Closes https://github.com/gitlabhq/gitlabhq/issues/9502
* Re-annotate modelsAtsushi Ishida2015-08-031-0/+1
|
* Add User.find_by_username!rs-issue-2012Robert Speicher2015-07-231-0/+12
|
* Add User#disable_two_factor!rs-disable-2faRobert Speicher2015-07-101-0/+18
| | | | | This method encapsulates all the logic for disabling 2FA on a specific User model.
* Only look up Commit authors/committers by emailrs-issue-1850Robert Speicher2015-06-231-10/+4
| | | | | - Removes looking up authors/committers by name - Renames `User.find_for_commit` to `User.find_by_any_email`
* Merge branch 'rs-dev-issue-2414' into 'master'Dmitriy Zaporozhets2015-06-231-36/+38
|\ | | | | | | | | | | | | | | | | | | Allow Admin to filter users by 2FA status > ![Screen_Shot_2015-06-19_at_4.38.12_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/deba7f2a6b8d1548c1d1ac401e0e35a1/Screen_Shot_2015-06-19_at_4.38.12_PM.png) Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2414 See merge request !852
| * Use alias_attribute to define User#two_factor_enabledrs-dev-issue-2414Robert Speicher2015-06-221-24/+0
| |
| * Make default value for otp_required_for_login false instead of nullRobert Speicher2015-06-201-2/+2
| |
| * Allow Admin to filter users by 2FA statusRobert Speicher2015-06-191-10/+36
| |
* | Update mock and stub syntax for specsRobert Speicher2015-06-221-4/+8
| |
* | Merge branch 'rs-dev-issue-2355' into 'master'Dmitriy Zaporozhets2015-06-221-0/+25
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | MergeRequest#show performance improvements This is a first pass on improving the performance of the `MergeRequests#show` page. Notable changes: - The "Commits" tab is loaded lazily, so the initial page load should be much faster for MRs with many commits. - Relative timestamps via `timeago` are only initialized once per load instead of `O(n^2)`. This greatly improves frontend rendering times for a large number of commits. - Refactored `User.find_for_commit` to use a single ARel-generated SQL query instead of the old method which resulted in one query, and could result in up to three. See merge request !838
| * Spec and refactor User.find_for_commitRobert Speicher2015-06-171-0/+25
| | | | | | | | | | Now it executes a single query instead of a possible three at the cost of some scary-looking ARel calls.
* | Add convenience methods to User for getting and setting 2FA statusRobert Speicher2015-06-191-0/+24
|/
* Add `dashboard` attribute to User modelRobert Speicher2015-06-131-1/+2
|
* Add Gitlab::Themes module; remove Gitlab::ThemeRobert Speicher2015-06-131-2/+2
| | | | | | | Now we can simply loop through all themes, among other things. This also removes the `dark_theme` / `light_theme` classes and the `theme_type` helper, since they weren't used anywhere.
* ensure_length_of -> validate_length_ofRobert Speicher2015-06-101-1/+1
|
* Merge branch 'make-namespaces-api-available-to-all-users' into 'master'Dmitriy Zaporozhets2015-06-041-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make namespace API available to all users ### What does this MR do? This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API. ### Why was this MR needed? Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9328 See merge request !708
| * Make namespace API available to all usersStan Hu2015-05-281-0/+2
| | | | | | | | Closes https://github.com/gitlabhq/gitlabhq/issues/9328
* | You can not remove user if he/she is an only owner of groupDmitriy Zaporozhets2015-05-281-1/+17
|/ | | | | | | To prevent loose of group data you need to transfer or remove group first before you can remove user Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Minor model spec cleanupsRobert Speicher2015-05-261-3/+0
| | | | Snippet model was missing project association
* Add `to_reference` for models that support referencesRobert Speicher2015-05-261-1/+19
| | | | | Now there is a single source of information for which attribute a model uses to be referenced, and its special character.
* Re-annotate User modelRobert Speicher2015-05-091-0/+5
|
* Re-annotate modelsStan Hu2015-05-031-0/+2
|
* Add application setting to restrict user signups to e-mail domainsStan Hu2015-05-021-0/+47
| | | | | | | | | | | This feature was requested long ago: http://feedback.gitlab.com/forums/176466-general/suggestions/4118466-ability-to-register-only-from-ceratain-domains This MR is based off !253 but changed to use application settings and use wildcard strings to give more flexibility in pattern matching. Regexps seemed overkill and easy to get wrong. Only restrict e-mail addresses upon creation
* Move User.cleanup_username to Namespace.cleanup_path.Douwe Maan2015-03-271-10/+0
|
* Re-annotate modelsDmitriy Zaporozhets2015-03-041-41/+47
|
* Fix and test User#contributed_projects_ids.Douwe Maan2015-02-271-0/+28
|
* Prevent autogenerated OAuth username to clash with existing namespace.Douwe Maan2015-02-131-2/+2
|
* Merge branch 'master' of github.com:gitlabhq/gitlabhqDmitriy Zaporozhets2015-02-121-98/+98
|\