Commit bf601f07 authored by Tim Zallmann's avatar Tim Zallmann

Fixed spec test syntax errors

parent c7bf2bfd
require 'spec_helper' require 'spec_helper'
describe 'Top Plus Menu', :js, :feature do feature 'Top Plus Menu', feature: true, js: true do
let!(:user) { create :user } let!(:user) { create :user }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:public_group) { create(:group, :public) } let!(:public_group) { create(:group, :public) }
...@@ -20,7 +20,7 @@ describe 'Top Plus Menu', :js, :feature do ...@@ -20,7 +20,7 @@ describe 'Top Plus Menu', :js, :feature do
login_as :user login_as :user
end end
scenario 'click on New project shows new project page' scenario 'click on New project shows new project page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New project") click_topmenuitem("New project")
...@@ -29,7 +29,7 @@ describe 'Top Plus Menu', :js, :feature do ...@@ -29,7 +29,7 @@ describe 'Top Plus Menu', :js, :feature do
expect(page).to have_content('Project name') expect(page).to have_content('Project name')
end end
scenario 'click on New group shows new group page' scenario 'click on New group shows new group page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New group") click_topmenuitem("New group")
...@@ -38,7 +38,7 @@ describe 'Top Plus Menu', :js, :feature do ...@@ -38,7 +38,7 @@ describe 'Top Plus Menu', :js, :feature do
expect(page).to have_content('Group name') expect(page).to have_content('Group name')
end end
scenario 'click on New group shows new group page' scenario 'click on New snippet shows new snippet page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New snippet") click_topmenuitem("New snippet")
...@@ -46,6 +46,60 @@ describe 'Top Plus Menu', :js, :feature do ...@@ -46,6 +46,60 @@ describe 'Top Plus Menu', :js, :feature do
expect(page).to have_content('New Snippet') expect(page).to have_content('New Snippet')
expect(page).to have_content('Title') expect(page).to have_content('Title')
end end
scenario 'click on New issue shows new issue page' do
visit namespace_project_path(empty_project.namespace, empty_project)
click_topmenuitem("New issue")
expect(page).to have_content('New Issue')
expect(page).to have_content('Title')
end
scenario 'click on New merge request shows new merge request page' do
visit namespace_project_path(empty_project.namespace, empty_project)
click_topmenuitem("New merge request")
expect(page).to have_content('New Merge Request')
expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch')
end
scenario 'click on New project snippet shows new snippet page' do
visit namespace_project_path(empty_project.namespace, empty_project)
page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
find('.header-new-project-snippet a').trigger('click')
end
expect(page).to have_content('New Snippet')
expect(page).to have_content('Title')
end
scenario 'Click on New subgroup shows new group page' do
visit group_path(group)
click_topmenuitem("New subgroup")
expect(page).to have_content('Group path')
expect(page).to have_content('Group name')
end
scenario 'Click on New project in group shows new project page' do
visit group_path(group)
page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
find('.header-new-group-project a').trigger('click')
end
expect(page).to have_content('Project path')
expect(page).to have_content('Project name')
end
end end
def click_topmenuitem(item_name) def click_topmenuitem(item_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment