summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Create and use project path helpers that only need a project, no namespaceDouwe Maan2017-07-05275-1131/+1023
|
* Handles realtime with 2 states for environments tableFilipa Lacerda2017-07-051-0/+21
|
* Revert "Merge branch '18000-remember-me-for-oauth-login' into 'master'"revert-6df61942Sean McGivern2017-07-055-160/+1
| | | This reverts merge request !11963
* Merge branch '23036-replace-snippets-spinach' into 'master'Rémy Coutable2017-07-056-14/+53
|\ | | | | | | | | Replace 'snippets/snippets.feature' spinach with rspec See merge request !12385
| * Replace 'snippets/snippets.feature' spinach with rspecAlexander Randa2017-07-056-14/+53
| |
* | Merge branch '33580-fix-api-scoping' into 'master'Douwe Maan2017-07-056-12/+199
|\ \ | | | | | | | | | | | | | | | | | | Fix API Scoping Closes #33580 and #33022 See merge request !12300
| * | Fix build for !12300.Timothy Andrew2017-07-051-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | - The `/users` and `/users/:id` APIs are now accessible without authentication (!12445), and so scopes are not relevant for these endpoints. - Previously, we were testing our scope declaration against these two methods. This commit moves these tests to other `GET` user endpoints which still require authentication.
| * | Merge branch 'master' into '33580-fix-api-scoping'Douwe Maan2017-07-04155-2784/+8190
| |\ \ | | | | | | | | | | | | # Conflicts: # lib/api/users.rb
| * | | `AccessTokenValidationService` accepts `String` or `API::Scope` scopes.Timothy Andrew2017-06-301-6/+6
| | | | | | | | | | | | | | | | | | | | - There's no need to use `API::Scope` for scopes that don't have `if` conditions, such as in `lib/gitlab/auth.rb`.
| * | | Extract a `Gitlab::Scope` class.Timothy Andrew2017-06-291-12/+8
| | | | | | | | | | | | | | | | | | | | - To represent an authorization scope, such as `api` or `read_user` - This is a better abstraction than the hash we were previously using.
| * | | Implement review comments from @DouweM for !12300.Timothy Andrew2017-06-281-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use a struct for scopes, so we can call `scope.if` instead of `scope[:if]` - Refactor the "remove scopes whose :if condition returns false" logic to use a `select` rather than a `reject`.
| * | | Implement review comments from @dbalexandre for !12300.Timothy Andrew2017-06-281-13/+11
| | | |
| * | | Fix remaining spec failures for !12300.Timothy Andrew2017-06-283-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Get the spec for `lib/gitlab/auth.rb` passing. - Make the `request` argument to `AccessTokenValidationService` optional - `auth.rb` doesn't need to pass in a request. - Pass in scopes in the format `[{ name: 'api' }]` rather than `['api']`, which is what `AccessTokenValidationService` now expects. 2. Get the spec for `API::V3::Users` passing 2. Get the spec for `AccessTokenValidationService` passing
| * | | Test OAuth token scope verification in the `API::Users` endpointTimothy Andrew2017-06-283-14/+71
| | | |
| * | | Test `/users` endpoints for the `read_user` scope.Timothy Andrew2017-06-284-34/+78
| | | | | | | | | | | | | | | | | | | | | | | | - Test `GET` endpoints to check that the scope is allowed. - Test `POST` endpoints to check that the scope is disallowed. - Test both `v3` and `v4` endpoints.
| * | | Allow API scope declarations to be applied conditionally.Timothy Andrew2017-06-283-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Scope declarations of the form: allow_access_with_scope :read_user, if: -> (request) { request.get? } will only apply for `GET` requests - Add a negative test to a `POST` endpoint in the `users` API to test this. Also test for this case in the `AccessTokenValidationService` unit tests.
| * | | Initial attempt at refactoring API scope declarations.Timothy Andrew2017-06-282-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Declaring an endpoint's scopes in a `before` block has proved to be unreliable. For example, if we're accessing the `API::Users` endpoint - code in a `before` block in `API::API` wouldn't be able to see the scopes set in `API::Users` since the `API::API` `before` block runs first. - This commit moves these declarations to the class level, since they don't need to change once set.
* | | | Merge branch '18000-remember-me-for-oauth-login' into 'master'Sean McGivern2017-07-055-1/+160
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Honor the "Remember me" parameter for OAuth-based login Closes #18000 See merge request !11963
| * | | | Add Jasmine tests for `OAuthRememberMe`Timothy Andrew2017-07-042-0/+31
| | | | |
| * | | | Fix build for !11963.Timothy Andrew2017-07-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use `request.env['omniauth.params']` if it isn't present. - Remove the `saml` section from the `gitlab.yml` test section. Some tests depend on this section not being initially present, so it can be overridden in the test. This MR doesn't add any tests for SAML, so we didn't really need this in the first place anyway. - Clean up the test -> omniauth section of `gitlab.yml`
| * | | | Implement review comments for !11963 from @adamniedzielski.Timothy Andrew2017-07-033-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Change double quotes to single quotes. - Why is `OmniAuth.config.full_host` being reassigned in the integration test? - Use `map` over `map!` to avoid `dup` in the `gitlab:info` rake task - Other minor changes
| * | | | Add Omniauth OAuth config to the test section of `gitlab.yml`Timothy Andrew2017-07-031-51/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - I tried to get this to work by stubbing out portions of the config within the test. This didn't work as expected because Devise/Omniauth loaded before the stub could run, and the stubbed config was ignored. - I attempted to fix this by reloading Devise/Omniauth after stubbing the config. This successfully got Devise to load the stubbed providers, but failed while trying to access a route such as `user_gitlab_omniauth_authorize_path`. - I spent a while trying to figure this out (even trying `Rails.application.reload_routes!`), but nothing seemed to work. - I settled for adding this config directly to `gitlab.yml` rather than go down this path any further.
| * | | | Add more providers to the OAuth login integration tests.Timothy Andrew2017-07-031-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | - Added saml, authentiq, cas3, and auth0 - Crowd seems to be a special case that will be handled separately.
| * | | | Test the "Remember Me" flow for OAuth-based login.Timothy Andrew2017-07-033-3/+68
| | | | |
| * | | | Add integration tests around OAuth login.Timothy Andrew2017-07-032-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - There was previously a test for `saml` login in `login_spec`, but this didn't seem to be passing. A lot of things didn't seem right here, and I suspect that this test hasn't been running. I'll investigate this further. - It took almost a whole working day to figure out this line: OmniAuth.config.full_host = ->(request) { request['REQUEST_URI'].sub(request['REQUEST_PATH'], '') } As always, it's obvious in retrospect, but it took some digging to figure out tests were failing and returning 404s during the callback phase. - Test all OAuth providers - github, twitter, bitbucket, gitlab, google, and facebook
* | | | | Merge branch '34648-use-stub_application_setting-to-test-support_url' into ↵Sean McGivern2017-07-051-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Use stub_application_setting when testing ApplicationHelper#support_url Closes #34648 See merge request !12627
| * | | | | Use stub_application_setting when testing ApplicationHelper#support_url34648-use-stub_application_setting-to-test-support_urlRémy Coutable2017-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | | Merge branch 'feature/gb/add-test-example-for-commit-status-retries' into ↵Sean McGivern2017-07-051-0/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Add test example for external commit status retries See merge request !12642
| * | | | | | Add test example for external commit status retriesfeature/gb/add-test-example-for-commit-status-retriesGrzegorz Bizon2017-07-051-0/+22
| | | | | | |
* | | | | | | Merge branch 'gitaly-submodule-url-for' into 'master'Sean McGivern2017-07-051-0/+32
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate #submodule_url_for to Gitaly See merge request !12629
| * | | | | | | Migrate #submodule_url_for to GitalyJacob Vosmaer2017-07-051-0/+32
| | |/ / / / / | |/| | | | |
* | | | | | | Merge branch 'dm-always-verify-source-branch-can-be-deleted' into 'master'Sean McGivern2017-07-041-11/+58
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent accidental deletion of protected MR source branch by repeating checks before actual deletion Closes #34456 See merge request !12574
| * | | | | | | Prevent accidental deletion of protected MR source branch by repeating ↵dm-always-verify-source-branch-can-be-deletedDouwe Maan2017-07-041-11/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checks before actual deletion
* | | | | | | | Merge branch 'revert-2c879643' into 'master'Sean McGivern2017-07-041-0/+21
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Merge branch 'revert-12499' into 'master'" See merge request !12633
| * | | | | | | | Revert "Merge branch 'revert-12499' into 'master'"revert-2c879643Douwe Maan2017-07-041-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts merge request !12557
* | | | | | | | | Merge branch 'feature/no-hypen-at-end-of-commit-ref-slug' into 'master'Rémy Coutable2017-07-041-7/+11
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | no trailing / leading hyphens in CI_COMMIT_REF_SLUG. Closes #32035 See merge request !11218
| * | | | | | | | fixed incorrect test case (for real), added another oneStefan Hanreich2017-06-191-1/+2
| | | | | | | | |
| * | | | | | | | fixed incorrect test caseStefan Hanreich2017-06-191-1/+1
| | | | | | | | |
| * | | | | | | | added additional test caseStefan Hanreich2017-06-181-0/+1
| | | | | | | | |
| * | | | | | | | remove trailing commaStefan Hanreich2017-06-181-1/+1
| | | | | | | | |
| * | | | | | | | fix typoStefan Hanreich2017-06-181-1/+1
| | | | | | | | |
| * | | | | | | | removed superfluos testsStefan Hanreich2017-06-181-7/+1
| | | | | | | | |
| * | | | | | | | Updated spec for build to include new ref_slug invariantsStefan Hanreich2017-06-181-8/+16
| | | | | | | | |
* | | | | | | | | Instrument Unicorn with Ruby exporterPaweł Chojnacki2017-07-044-6/+210
| | | | | | | | |
* | | | | | | | | Remove group modal like remove project modal. Closes #33130Diego Souza2017-07-041-3/+9
| |_|_|_|_|_|/ / |/| | | | | | |
* | | | | | | | Merge branch 'mk-workaround-intermittent-failure' into 'master'Douwe Maan2017-07-041-14/+24
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hopefully reduce the rate of this intermittent failure in CI Closes #31128 See merge request !12567
| * | | | | | | | Reduce 28 test runs to 4mk-workaround-intermittent-failureMichael Kozono2017-06-301-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 14 to 2, but these shared examples are used twice. This was already done in another context further down the file.
| * | | | | | | | Rspec/AroundBlock doesn’t know about rspec-retryMichael Kozono2017-06-291-1/+1
| | | | | | | | |
| * | | | | | | | Increase CI retries to 4 for these examplesMichael Kozono2017-06-291-0/+6
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | By default it is 2 tries in CI.
* | | | | | | | Merge branch 'tc-namespace-license-checks--multiple-assignees' into 'master'Douwe Maan2017-07-043-12/+44
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CE counterpart of: Namespace license checks for multiple assignees See merge request !11825