Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
edd07e23
Commit
edd07e23
authored
Apr 15, 2016
by
Sebastian Klier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wiki tests
parent
ca3e1d9e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
app/services/wiki_pages/base_service.rb
app/services/wiki_pages/base_service.rb
+1
-1
spec/factories/project_wikis.rb
spec/factories/project_wikis.rb
+7
-0
spec/factories/wiki_pages.rb
spec/factories/wiki_pages.rb
+9
-0
spec/lib/gitlab/url_builder_spec.rb
spec/lib/gitlab/url_builder_spec.rb
+9
-0
No files found.
app/services/wiki_pages/base_service.rb
View file @
edd07e23
...
@@ -11,7 +11,7 @@ module WikiPages
...
@@ -11,7 +11,7 @@ module WikiPages
repository:
@project
.
hook_attrs
.
slice
(
:name
,
:url
,
:description
,
:homepage
)
repository:
@project
.
hook_attrs
.
slice
(
:name
,
:url
,
:description
,
:homepage
)
}
}
page_url
=
Gitlab
::
UrlBuilder
.
new
(
:wiki_page
).
build
(
page
)
page_url
=
Gitlab
::
UrlBuilder
.
build
(
page
)
hook_data
[
:object_attributes
].
merge!
(
url:
page_url
,
action:
action
)
hook_data
[
:object_attributes
].
merge!
(
url:
page_url
,
action:
action
)
hook_data
hook_data
end
end
...
...
spec/factories/project_wikis.rb
0 → 100644
View file @
edd07e23
FactoryGirl
.
define
do
factory
:project_wiki
do
project
factory: :empty_project
user
factory: :user
initialize_with
{
new
(
project
,
user
)
}
end
end
spec/factories/wiki_pages.rb
0 → 100644
View file @
edd07e23
require
'ostruct'
FactoryGirl
.
define
do
factory
:wiki_page
do
page
=
OpenStruct
.
new
(
url_path:
'some-name'
)
association
:wiki
,
factory: :project_wiki
,
strategy: :build
initialize_with
{
new
(
wiki
,
page
,
true
)
}
end
end
spec/lib/gitlab/url_builder_spec.rb
View file @
edd07e23
...
@@ -106,5 +106,14 @@ describe Gitlab::UrlBuilder, lib: true do
...
@@ -106,5 +106,14 @@ describe Gitlab::UrlBuilder, lib: true do
end
end
end
end
end
end
context
'when passing a WikiPage'
do
it
'returns a proper URL'
do
wiki_page
=
build
(
:wiki_page
)
url
=
described_class
.
build
(
wiki_page
)
expect
(
url
).
to
eq
"
#{
Gitlab
.
config
.
gitlab
.
url
}#{
wiki_page
.
wiki
.
wiki_base_path
}
/
#{
wiki_page
.
slug
}
"
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment