diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-10-12 15:53:46 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-10-13 15:42:52 +0300 |
commit | c30f92464e1fcdb507d0d22b36be2d31e83064ec (patch) | |
tree | 150614865bccf136d157f5dfdd295f11076dd287 /spec/features/projects/wiki | |
parent | 9ac5338b8eb361927ad068486398b92acb0c287e (diff) |
Replaces 'WikiPage::CreateService' calls with 'wiki_page' factory
We replace the usage of WikiPage::CreateService with the wiki_page factory in the specs.
Diffstat (limited to 'spec/features/projects/wiki')
4 files changed, 3 insertions, 18 deletions
diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index 78c350c8ee4..d63cbe578d8 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -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) diff --git a/spec/features/projects/wiki/shortcuts_spec.rb b/spec/features/projects/wiki/shortcuts_spec.rb index eaff5f876b6..f70d1e710dd 100644 --- a/spec/features/projects/wiki/shortcuts_spec.rb +++ b/spec/features/projects/wiki/shortcuts_spec.rb @@ -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) diff --git a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb index 9a92622ba2b..37a118c34ab 100644 --- a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb @@ -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) diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb index cf9fe4c1ad1..ebb3bd044c1 100644 --- a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -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 |