summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-05-02 17:49:51 +0200
committerRémy Coutable <remy@rymai.me>2016-05-02 18:34:14 +0200
commitf1e74de47cd9fcf334617023aaa737c83c98a7f2 (patch)
tree24a6463184343e6681a00a5177c089c6df5f82b6
parent3811eb0ba1e8c0f318060696853b1cab7f99dfa3 (diff)
downloadgitlab-ce-15527-fix-wiki-page-creation-issue.tar.gz
Simplify specs by not over-expecting15527-fix-wiki-page-creation-issue
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--CHANGELOG2
-rw-r--r--spec/features/projects/wiki/user_creates_wiki_page_spec.rb32
-rw-r--r--spec/features/projects/wiki/user_updates_wiki_page_spec.rb18
3 files changed, 23 insertions, 29 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bcbcdfc3fc6..efaa5f43d58 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,7 +15,7 @@ v 8.8.0 (unreleased)
- Files over 5MB can only be viewed in their raw form, files over 1MB without highlighting !3718
- Add support for supressing text diffs using .gitattributes on the default branch (Matt Oakes)
-v 8.7.2 (unreleased)
+v 8.7.2
- The "New Branch" button is now loaded asynchronously
- Fix error 500 when trying to create a wiki page
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 d709fe8046f..7e6eef65873 100644
--- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
@@ -11,17 +11,16 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_link 'Wiki'
end
- context 'wiki project is in the user namespace' do
+ context 'in the user namespace' do
let(:project) { create(:project, namespace: user.namespace) }
context 'when wiki is empty' do
- scenario 'user can create a new wiki page from the wiki home page' do
- expect(page).to have_content('Home · Edit Page')
-
+ scenario 'directly from the wiki home page' do
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Create page'
- expect(page).to have_content("Home · last edited by #{user.name}")
+ expect(page).to have_content('Home')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end
@@ -31,34 +30,32 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute
end
- scenario 'user can create a new wiki page', js: true do
+ scenario 'via the "new wiki page" page', js: true do
click_link 'New Page'
fill_in :new_wiki_path, with: 'foo'
click_button 'Create Page'
- expect(page).to have_content('Foo · Edit Page')
-
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Create page'
- expect(page).to have_content("Foo · last edited by #{user.name}")
+ expect(page).to have_content('Foo')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end
end
- context 'wiki project is in the user namespace' do
+ context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) }
context 'when wiki is empty' do
- scenario 'user can create a new wiki page from the wiki home page' do
- expect(page).to have_content('Home · Edit Page')
-
+ scenario 'directly from the wiki home page' do
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Create page'
- expect(page).to have_content("Home · last edited by #{user.name}")
+ expect(page).to have_content('Home')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end
@@ -68,18 +65,17 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute
end
- scenario 'user can create a new wiki page', js: true do
+ scenario 'via the "new wiki page" page', js: true do
click_link 'New Page'
fill_in :new_wiki_path, with: 'foo'
click_button 'Create Page'
- expect(page).to have_content('Foo · Edit Page')
-
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Create page'
- expect(page).to have_content("Foo · last edited by #{user.name}")
+ expect(page).to have_content('Foo')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end
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 b69d6b46ac8..ef82d2375dd 100644
--- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
@@ -12,34 +12,32 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
click_link 'Wiki'
end
- context 'wiki project is in the user namespace' do
+ context 'in the user namespace' do
let(:project) { create(:project, namespace: user.namespace) }
- scenario 'user can update the wiki home page' do
+ scenario 'the home page' do
click_link 'Edit'
- expect(page).to have_content('Home · Edit Page')
-
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Save changes'
- expect(page).to have_content("Home · last edited by #{user.name}")
+ expect(page).to have_content('Home')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end
- context 'wiki project is in the user namespace' do
+ context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) }
- scenario 'user can update the wiki home page' do
+ scenario 'the home page' do
click_link 'Edit'
- expect(page).to have_content('Home · Edit Page')
-
fill_in :wiki_content, with: 'My awesome wiki!'
click_button 'Save changes'
- expect(page).to have_content("Home · last edited by #{user.name}")
+ expect(page).to have_content('Home')
+ expect(page).to have_content("last edited by #{user.name}")
expect(page).to have_content('My awesome wiki!')
end
end