diff options
author | Hiroyuki Sato <h-sato@ruby-dev.jp> | 2017-03-04 23:03:14 +0900 |
---|---|---|
committer | Hiroyuki Sato <sathiroyuki@gmail.com> | 2017-03-08 18:42:50 +0900 |
commit | a5521bad4012a9eea21cb067271c8ec1810c6d8c (patch) | |
tree | 3544226812c93e9abfcaceafd939fc4a168ecd61 /spec/features | |
parent | e78a366925553a1268f8dc6e0d57342053a3240a (diff) | |
download | gitlab-ce-a5521bad4012a9eea21cb067271c8ec1810c6d8c.tar.gz |
Prevent concurrent editing wiki
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/wiki/user_updates_wiki_page_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index f842d14fa96..a15bb3ad46b 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -8,7 +8,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do login_as(user) visit namespace_project_path(project.namespace, project) - WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute + @wiki_page = WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute click_link 'Wiki' end @@ -25,6 +25,16 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do expect(page).to have_content("Last edited by #{user.name}") expect(page).to have_content('My awesome wiki!') end + + scenario 'page has been updated since the user opened the edit page' do + click_link 'Edit' + + @wiki_page.update("Update") + + click_button 'Save changes' + + expect(page).to have_content 'Someone edited the page the same time you did.' + end end context 'in a group namespace' do |