BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c30f9246
Commit
c30f9246
authored
Oct 12, 2017
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces 'WikiPage::CreateService' calls with 'wiki_page' factory
We replace the usage of WikiPage::CreateService with the wiki_page factory in the specs.
parent
9ac5338b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
27 deletions
+12
-27
37571-replace-wikipage-createservice-with-factory.yml
...sed/37571-replace-wikipage-createservice-with-factory.yml
+5
-0
markdown_preview_spec.rb
spec/features/projects/wiki/markdown_preview_spec.rb
+0
-1
shortcuts_spec.rb
spec/features/projects/wiki/shortcuts_spec.rb
+1
-3
user_git_access_wiki_page_spec.rb
.../features/projects/wiki/user_git_access_wiki_page_spec.rb
+1
-8
user_views_wiki_in_project_page_spec.rb
...res/projects/wiki/user_views_wiki_in_project_page_spec.rb
+1
-6
readme_spec.rb
spec/models/blob_viewer/readme_spec.rb
+1
-1
microsoft_teams_service_spec.rb
spec/models/project_services/microsoft_teams_service_spec.rb
+2
-6
slack_mattermost_notifications_shared_examples.rb
...support/slack_mattermost_notifications_shared_examples.rb
+1
-2
No files found.
changelogs/unreleased/37571-replace-wikipage-createservice-with-factory.yml
0 → 100644
View file @
c30f9246
---
title
:
Replace WikiPage::CreateService calls with wiki_page factory in specs
merge_request
:
14850
author
:
Jacopo Beschi @jacopo-beschi
type
:
changed
spec/features/projects/wiki/markdown_preview_spec.rb
View file @
c30f9246
...
...
@@ -14,7 +14,6 @@ feature 'Projects > Wiki > User previews markdown changes', :js do
background
do
project
.
team
<<
[
user
,
:master
]
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
sign_in
(
user
)
...
...
spec/features/projects/wiki/shortcuts_spec.rb
View file @
c30f9246
...
...
@@ -3,9 +3,7 @@ require 'spec_helper'
feature
'Wiki shortcuts'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:wiki_page
)
do
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
end
let
(
:wiki_page
)
{
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
{
title:
'home'
,
content:
'Home page'
})
}
before
do
sign_in
(
user
)
...
...
spec/features/projects/wiki/user_git_access_wiki_page_spec.rb
View file @
c30f9246
...
...
@@ -3,14 +3,7 @@ require 'spec_helper'
describe
'Projects > Wiki > User views Git access wiki page'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:wiki_page
)
do
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'[some link](other-page)'
).
execute
end
let
(
:wiki_page
)
{
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
{
title:
'home'
,
content:
'[some link](other-page)'
})
}
before
do
sign_in
(
user
)
...
...
spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb
View file @
c30f9246
...
...
@@ -18,12 +18,7 @@ describe 'Projects > Wiki > User views wiki in project page' do
context
'when wiki homepage contains a link'
do
before
do
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'[some link](other-page)'
).
execute
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
{
title:
'home'
,
content:
'[some link](other-page)'
})
end
it
'displays the correct URL for the link'
do
...
...
spec/models/blob_viewer/readme_spec.rb
View file @
c30f9246
...
...
@@ -37,7 +37,7 @@ describe BlobViewer::Readme do
context
'when the wiki is not empty'
do
before
do
WikiPages
::
CreateService
.
new
(
project
,
project
.
owner
,
title:
'home'
,
content:
'Home page'
).
execute
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
{
title:
'home'
,
content:
'Home page'
})
end
it
'returns nil'
do
...
...
spec/models/project_services/microsoft_teams_service_spec.rb
View file @
c30f9246
...
...
@@ -108,12 +108,8 @@ describe MicrosoftTeamsService do
message:
"user created page: Awesome wiki_page"
}
end
let
(
:wiki_page_sample_data
)
do
service
=
WikiPages
::
CreateService
.
new
(
project
,
user
,
opts
)
wiki_page
=
service
.
execute
Gitlab
::
DataBuilder
::
WikiPage
.
build
(
wiki_page
,
user
,
'create'
)
end
let
(
:wiki_page
)
{
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
opts
)
}
let
(
:wiki_page_sample_data
)
{
Gitlab
::
DataBuilder
::
WikiPage
.
build
(
wiki_page
,
user
,
'create'
)
}
it
"calls Microsoft Teams API"
do
chat_service
.
execute
(
wiki_page_sample_data
)
...
...
spec/support/slack_mattermost_notifications_shared_examples.rb
View file @
c30f9246
...
...
@@ -76,8 +76,7 @@ RSpec.shared_examples 'slack or mattermost notifications' do
message:
"user created page: Awesome wiki_page"
}
wiki_page_service
=
WikiPages
::
CreateService
.
new
(
project
,
user
,
opts
)
@wiki_page
=
wiki_page_service
.
execute
@wiki_page
=
create
(
:wiki_page
,
wiki:
project
.
wiki
,
attrs:
opts
)
@wiki_page_sample_data
=
Gitlab
::
DataBuilder
::
WikiPage
.
build
(
@wiki_page
,
user
,
'create'
)
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