diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-07-06 08:30:57 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-07-06 08:30:57 +0000 |
commit | afd5c34d9f1bf5ad7d85209dfecbaf28c6c12496 (patch) | |
tree | 1220cad52c8015883e7581b051d2c0b4821b6599 /spec | |
parent | 2520edefb9a7481f575ac7bcdbcf89cb1432f27d (diff) | |
parent | a99083424b80345d0be89d5393b7980fcfea2264 (diff) | |
download | gitlab-ce-afd5c34d9f1bf5ad7d85209dfecbaf28c6c12496.tar.gz |
Merge branch '34698-fix-transient-failure' into 'master'
Fix a nasty transient failure happening is a subsequent spec
Closes #34698
See merge request !12664
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/wiki/user_creates_wiki_page_spec.rb | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index 86b31057a55..9d66f482c8d 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -1,20 +1,23 @@ require 'spec_helper' -feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do +feature 'Projects > Wiki > User creates wiki page', :js do let(:user) { create(:user) } background do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_path(project) - find('.shortcuts-wiki').trigger('click') end context 'in the user namespace' do let(:project) { create(:project, namespace: user.namespace) } context 'when wiki is empty' do + before do + find('.shortcuts-wiki').trigger('click') + end + scenario 'commit message field has value "Create home"' do expect(page).to have_field('wiki[message]', with: 'Create home') end @@ -67,10 +70,11 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do context 'when wiki is not empty' do before do WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute + find('.shortcuts-wiki').trigger('click') end context 'via the "new wiki page" page' do - scenario 'when the wiki page has a single word name', js: true do + scenario 'when the wiki page has a single word name' do click_link 'New page' page.within '#modal-new-wiki' do @@ -91,7 +95,7 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do expect(page).to have_content('My awesome wiki!') end - scenario 'when the wiki page has spaces in the name', js: true do + scenario 'when the wiki page has spaces in the name' do click_link 'New page' page.within '#modal-new-wiki' do @@ -112,7 +116,7 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do expect(page).to have_content('My awesome wiki!') end - scenario 'when the wiki page has hyphens in the name', js: true do + scenario 'when the wiki page has hyphens in the name' do click_link 'New page' page.within '#modal-new-wiki' do @@ -134,7 +138,7 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do end end - scenario 'content has autocomplete', :js do + scenario 'content has autocomplete' do click_link 'New page' page.within '#modal-new-wiki' do @@ -156,6 +160,10 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do let(:project) { create(:project, namespace: create(:group, :public)) } context 'when wiki is empty' do + before do + find('.shortcuts-wiki').trigger('click') + end + scenario 'commit message field has value "Create home"' do expect(page).to have_field('wiki[message]', with: 'Create home') end @@ -175,9 +183,10 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do context 'when wiki is not empty' do before do WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute + find('.shortcuts-wiki').trigger('click') end - scenario 'via the "new wiki page" page', js: true do + scenario 'via the "new wiki page" page' do click_link 'New page' page.within '#modal-new-wiki' do |