summaryrefslogtreecommitdiff
path: root/spec/factories/wiki_pages.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-08 10:29:20 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-09 10:04:15 +0530
commit8e71c19a6940b8d82c70ee9b2550b62b5169eb54 (patch)
tree2769fcd2159b446b04e3bde00a074aac160cf884 /spec/factories/wiki_pages.rb
parent30524901e28176e96e7c0d1a710508367ff99d9f (diff)
downloadgitlab-ce-8e71c19a6940b8d82c70ee9b2550b62b5169eb54.tar.gz
Implement the correct linking behaviour in `WikiLinkFilter`.
Original Comments ================= - Linking behaves as per rules documented here: https://gitlab.com/gitlab-org/gitlab-ce/blob/16568-document-wiki-linking-behavior/doc/markdown/wiki.md - All links (to other wiki pages) are rewritten to be at the level of the app root. We can't use links relative to the current page ('./foo', 'foo', '../foo'), because they won't work in the markdown preview, where the current page is suffixed with `/edit` - Move existing `WikiLinkFilter` specs to `WikiPipeline` spec. It makes sense to run these tests on the combined output of the pipeline, rather than a single filter, since we can catch issues with conflicting filters. - Add more tests to cover the new linking @rymai's Review =============== - Classes nested under `WikiLinkFilter` should declare `WikiLinkFilter`'s inherit, so nothing changes if the nested class is loaded first. - Add a blank line after a guard clause - Use keyword arguments for the `Rewriter` constructor - Invert a condition - use `if` instead of `unless` - Inline a `let` in `WikiPipeline` spec - it was only used in a single place - Change out of date spec names - Add a comment for every rewrite rule in `Rewriter`
Diffstat (limited to 'spec/factories/wiki_pages.rb')
-rw-r--r--spec/factories/wiki_pages.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/factories/wiki_pages.rb b/spec/factories/wiki_pages.rb
index 938ccf2306b..efa6cbe5bb1 100644
--- a/spec/factories/wiki_pages.rb
+++ b/spec/factories/wiki_pages.rb
@@ -2,7 +2,7 @@ require 'ostruct'
FactoryGirl.define do
factory :wiki_page do
- page = OpenStruct.new(url_path: 'some-name')
+ page { OpenStruct.new(url_path: 'some-name') }
association :wiki, factory: :project_wiki, strategy: :build
initialize_with { new(wiki, page, true) }
end