From 9219ac0aad82a41a0b177853d7a4a8f8ae0d4a44 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Mon, 1 Jan 2018 13:55:52 +0000 Subject: [PATCH] Add breadcrumbs to User Settings sub-views Closes #40274 --- app/views/doorkeeper/applications/show.html.haml | 2 ++ app/views/profiles/keys/show.html.haml | 2 ++ changelogs/unreleased/40274-user-settings-breadcrumbs.yml | 5 +++++ spec/features/profiles/keys_spec.rb | 1 + spec/features/profiles/oauth_applications_spec.rb | 8 ++++++++ 5 files changed, 18 insertions(+) create mode 100644 changelogs/unreleased/40274-user-settings-breadcrumbs.yml diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml index 72eab964766..6364f0be4a3 100644 --- a/app/views/doorkeeper/applications/show.html.haml +++ b/app/views/doorkeeper/applications/show.html.haml @@ -1,3 +1,5 @@ +- add_to_breadcrumbs "Applications", oauth_applications_path +- breadcrumb_title @application.name - page_title @application.name, "Applications" - @content_class = "limit-container-width" unless fluid_layout diff --git a/app/views/profiles/keys/show.html.haml b/app/views/profiles/keys/show.html.haml index 172c0450381..7b7960708c4 100644 --- a/app/views/profiles/keys/show.html.haml +++ b/app/views/profiles/keys/show.html.haml @@ -1,3 +1,5 @@ +- add_to_breadcrumbs "SSH Keys", profile_keys_path +- breadcrumb_title @key.title - page_title @key.title, "SSH Keys" - @content_class = "limit-container-width" unless fluid_layout = render 'profiles/head' diff --git a/changelogs/unreleased/40274-user-settings-breadcrumbs.yml b/changelogs/unreleased/40274-user-settings-breadcrumbs.yml new file mode 100644 index 00000000000..1f381668aca --- /dev/null +++ b/changelogs/unreleased/40274-user-settings-breadcrumbs.yml @@ -0,0 +1,5 @@ +--- +title: Fix breadcrumbs in User Settings +merge_request: 16172 +author: rfwatson +type: fixed diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 7d5ba3a7328..b04a5422fed 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -27,6 +27,7 @@ feature 'Profile > SSH Keys' do expect(page).to have_content("Title: #{attrs[:title]}") expect(page).to have_content(attrs[:key]) + expect(find('.breadcrumbs-sub-title')).to have_link(attrs[:title]) end context 'when only DSA and ECDSA keys are allowed' do diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb index d1edeef8da4..7d204f89fba 100644 --- a/spec/features/profiles/oauth_applications_spec.rb +++ b/spec/features/profiles/oauth_applications_spec.rb @@ -2,12 +2,20 @@ require 'spec_helper' describe 'Profile > Applications' do let(:user) { create(:user) } + let(:application) { create(:oauth_application, owner: user) } before do sign_in(user) end describe 'User manages applications', :js do + it 'views an application' do + visit oauth_application_path(application) + + expect(page).to have_content("Application: #{application.name}") + expect(find('.breadcrumbs-sub-title')).to have_link(application.name) + end + it 'deletes an application' do create(:oauth_application, owner: user) visit oauth_applications_path