Commit 839018d2 authored by Hiroyuki Sato's avatar Hiroyuki Sato

Refactor spec

parent a5521bad
...@@ -2,13 +2,13 @@ require 'spec_helper' ...@@ -2,13 +2,13 @@ require 'spec_helper'
feature 'Projects > Wiki > User updates wiki page', feature: true do feature 'Projects > Wiki > User updates wiki page', feature: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:wiki_page) { WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute }
background do background do
project.team << [user, :master] project.team << [user, :master]
login_as(user) login_as(user)
visit namespace_project_path(project.namespace, project) visit namespace_project_path(project.namespace, project)
@wiki_page = WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute
click_link 'Wiki' click_link 'Wiki'
end end
...@@ -29,7 +29,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do ...@@ -29,7 +29,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
scenario 'page has been updated since the user opened the edit page' do scenario 'page has been updated since the user opened the edit page' do
click_link 'Edit' click_link 'Edit'
@wiki_page.update("Update") wiki_page.update('Update')
click_button 'Save changes' click_button 'Save changes'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment