summaryrefslogtreecommitdiff
path: root/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/wiki/user_updates_wiki_page_spec.rb')
-rw-r--r--spec/features/projects/wiki/user_updates_wiki_page_spec.rb28
1 files changed, 23 insertions, 5 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 86cf520ea80..e3739a705bf 100644
--- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
@@ -1,15 +1,14 @@
require 'spec_helper'
-feature 'Projects > Wiki > User updates wiki page', feature: true do
+feature 'Projects > Wiki > User updates wiki page' do
let(:user) { create(:user) }
+ let!(:wiki_page) { WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute }
background do
project.team << [user, :master]
- login_as(user)
+ sign_in(user)
- visit namespace_project_path(project.namespace, project)
- WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute
- click_link 'Wiki'
+ visit project_wikis_path(project)
end
context 'in the user namespace' do
@@ -42,6 +41,25 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
expect(page).to have_content('Content can\'t be blank')
expect(find('textarea#wiki_content').value).to eq ''
end
+
+ scenario 'content has autocomplete', :js do
+ click_link 'Edit'
+
+ find('#wiki_content').native.send_keys('')
+ fill_in :wiki_content, with: '@'
+
+ expect(page).to have_selector('.atwho-view')
+ end
+ 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