summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2018-05-31 21:28:19 +0000
committerMike Greiling <mike@pixelcog.com>2018-05-31 21:28:19 +0000
commitbbff2d680d22051041be5fc5dd2e801fd1cc862d (patch)
tree1fe3aaca61bd8d49192a887ea32a99d52929ca50 /spec
parente16859c4e71a291b42db78178b274ce028ff41db (diff)
downloadgitlab-ce-bbff2d680d22051041be5fc5dd2e801fd1cc862d.tar.gz
Update 404 and 403 pages
Diffstat (limited to 'spec')
-rw-r--r--spec/features/error_pages_spec.rb42
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb2
2 files changed, 43 insertions, 1 deletions
diff --git a/spec/features/error_pages_spec.rb b/spec/features/error_pages_spec.rb
new file mode 100644
index 00000000000..cd7bcf29cc9
--- /dev/null
+++ b/spec/features/error_pages_spec.rb
@@ -0,0 +1,42 @@
+require 'spec_helper'
+
+describe 'Error Pages' do
+ let(:user) { create(:user) }
+ let(:project) { create(:project, :public) }
+
+ before do
+ sign_in(user)
+ end
+
+ shared_examples 'shows nav links' do
+ it 'shows nav links' do
+ expect(page).to have_link("Home", href: root_path)
+ expect(page).to have_link("Help", href: help_path)
+ expect(page).to have_link(nil, href: destroy_user_session_path)
+ end
+ end
+
+ describe '404' do
+ before do
+ visit '/not-a-real-page'
+ end
+
+ it 'allows user to search' do
+ fill_in 'search', with: 'something'
+ click_button 'Search'
+
+ expect(page).to have_current_path(%r{^/search\?.*search=something.*})
+ end
+
+ it_behaves_like 'shows nav links'
+ end
+
+ describe '403' do
+ before do
+ visit '/'
+ visit edit_project_path(project)
+ end
+
+ it_behaves_like 'shows nav links'
+ end
+end
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index af2a9567a47..35776a5f23b 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -379,7 +379,7 @@ describe 'Pipeline', :js do
end
it 'fails to access the page' do
- expect(page).to have_content('Access Denied')
+ expect(page).to have_title('Access Denied')
end
end
end