summaryrefslogtreecommitdiff
path: root/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/wiki/user_creates_wiki_page_spec.rb')
-rw-r--r--spec/features/projects/wiki/user_creates_wiki_page_spec.rb32
1 files changed, 14 insertions, 18 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 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