gitlab-ce/spec/support
Fatih Acet 4d37be0fb8 Merge branch '22781-user-generated-permalinks' into 'master'
Resolve "User-generated permalink IDs collide with GitLab interface"

## What does this MR do?

Prevents ID values automatically generated by headers in [GitLab Flavored Markdown](https://github.com/gitlabhq/gitlabhq/blob/master/doc/user/markdown.md#header-ids-and-links) from colliding with IDs used elsewhere in the GitLab interface.  This can cause confusion when, for instance, a selector looks for a merge request tab with `id="pipelines"` and there is a header with the same ID earlier in the DOM.

How this works:
* All header IDs generated with GitLab Flavored Markdown are namespaced with `id="user-content_foo"`
* All anchor links which point to these IDs continue to use the non-namespaced hash `<a href="#foo">...</a>`
* When a page is loaded or when the `hashchange` event is triggered, javascript will automatically search for `#user-content_foo` if `#foo` cannot be found, and scroll to that position instead.

## Before

![2016-11-21-13.00.28](/uploads/e3be2cd6a9142dfd6e64db5462a6aa76/2016-11-21-13.00.28.gif)

## After:

![2016-11-21-13.12.45](/uploads/f7ae3f3a30c91325eaa3665591b6a850/2016-11-21-13.12.45.gif)  
![2016-11-21-13.03.00](/uploads/3a6a782c081ecaa05b8781548d794909/2016-11-21-13.03.00.gif)  

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #22781 

See also prior attempts to address this issue:
#3908, !2023, !2024


See merge request !7631
2016-12-01 20:58:08 +00:00
..
api
banzai Fix Markdown styling inside reference links 2016-11-01 09:49:30 +00:00
cycle_analytics_helpers Implement a second round of review comments from @DouweM. 2016-09-21 00:47:37 +05:30
features Remove default value for `project` argument on subscribable concern 2016-11-17 15:10:13 -02:00
gitlab_stubs
import_export Merge branch 'fix/import-export-symlink-vulnerability' into 'security' 2016-11-03 16:04:18 +01:00
matchers Merge branch '22781-user-generated-permalinks' into 'master' 2016-12-01 20:58:08 +00:00
services Fix permission for setting an issue's due date 2016-09-28 17:41:32 +02:00
api_helpers.rb
capybara.rb Pass `--load-images=no` to PhantomJS via Capybara/Poltergeist 2016-11-28 16:50:08 +08:00
capybara_helpers.rb
carrierwave.rb Clear Carrierwave upload after each test example 2016-11-23 09:51:50 +01:00
cycle_analytics_helpers.rb Merge branch 'issue_23548_dev' into 'master' 2016-11-09 12:25:17 +01:00
database_connection_helpers.rb Write a spec covering the race condition during group deletion. 2016-11-18 14:27:13 +05:30
db_cleaner.rb Precalculate user's authorized projects in database 2016-11-18 20:25:45 +02:00
email_format_shared_examples.rb
email_helpers.rb Test against notification email 2016-10-21 18:22:09 +08:00
factory_girl.rb
fake_u2f_device.rb
filter_spec_helper.rb
fixture_helpers.rb
git_helpers.rb Generate branch/file names more randomly to avoid failures. 2016-09-07 11:26:07 +05:30
git_http_helpers.rb Added git http requests tests for user with LDAP identity 2016-09-28 08:43:21 +02:00
import_spec_helper.rb
issue_helpers.rb
issue_tracker_service_shared_example.rb Prevent wrong markdown on issue ids when project has Jira service activated 2016-10-19 13:46:04 -02:00
javascript_fixtures_helpers.rb Strip <link> tags from fixtures to ignore CSS 2016-11-25 11:03:35 +01:00
jira_service_helper.rb Allow enabling and disabling commit and MR events for JIRA 2016-11-18 15:17:51 -02:00
ldap_helpers.rb Request only the LDAP attributes we need 2016-09-09 13:14:57 -05:00
login_helpers.rb Fix nesting on sessions/new. 2016-10-15 08:28:53 +02:00
markdown_feature.rb
mentionable_shared_examples.rb Simplify Mentionable concern instance methods 2016-10-04 10:45:48 +02:00
merge_request_helpers.rb
notify_shared_examples.rb Merge remote-tracking branch 'upstream/master' into pipeline-notifications 2016-10-25 23:03:47 +08:00
omni_auth.rb
project_features_apply_to_issuables_shared_examples.rb Merge branch '22481-honour-issue-visibility-for-groups' into 'security' 2016-11-09 12:24:13 +01:00
project_hook_data_shared_example.rb
rake_helpers.rb Move task helpers to a module 2016-11-30 12:20:21 +01:00
reference_parser_helpers.rb
reference_parser_shared_examples.rb Merge branch 'issue_23548_dev' into 'master' 2016-11-09 12:25:17 +01:00
repo_helpers.rb
search_helpers.rb Fix broken commits search 2016-11-08 12:03:23 +02:00
select2_helper.rb Trigger change even in select2 test helper to produce production-like behaviour 2016-10-24 13:14:00 +03:00
services_shared_context.rb
setup_builds_storage.rb Clear test build storage directory before each example 2016-11-23 13:51:05 +01:00
slash_commands_helpers.rb Move write_note into SlashCommandsHelper and update other dependent specs 2016-09-08 18:52:55 -04:00
snippets_shared_examples.rb Fix snippets pagination 2016-09-26 12:42:12 +02:00
stub_configuration.rb Move task helpers to a module 2016-11-30 12:20:21 +01:00
stub_gitlab_calls.rb
stub_gitlab_data.rb
taskable_shared_examples.rb add "x of y tasks completed" on issuable 2016-10-28 14:01:36 -02:00
test_env.rb Fix Error 500 when creating a merge request that contains an image that was deleted and added 2016-11-14 15:57:01 +01:00
updating_mentions_shared_examples.rb
wait_for_ajax.rb Wait for ajax for every merge request spinach test 2016-10-18 18:55:11 +03:00
wait_for_vue_resource.rb Fixed tests 2016-09-15 18:20:36 -04:00
webmock.rb
workhorse_helpers.rb Verify JWT messages from gitlab-workhorse 2016-09-05 15:05:31 +02:00