diff --git a/app/controllers/wrangling_guidelines_controller.rb b/app/controllers/wrangling_guidelines_controller.rb index f015a185d6..86e9e266bd 100644 --- a/app/controllers/wrangling_guidelines_controller.rb +++ b/app/controllers/wrangling_guidelines_controller.rb @@ -9,6 +9,7 @@ def index # GET /wrangling_guidelines/1 def show @wrangling_guideline = WranglingGuideline.find(params[:id]) + @page_subtitle = @wrangling_guideline.title end # GET /wrangling_guidelines/new diff --git a/features/tags_and_wrangling/wrangling_guidelines.feature b/features/tags_and_wrangling/wrangling_guidelines.feature index 837b0709ed..1306ebdb8c 100644 --- a/features/tags_and_wrangling/wrangling_guidelines.feature +++ b/features/tags_and_wrangling/wrangling_guidelines.feature @@ -16,6 +16,7 @@ Feature: Wrangling Guidelines When I go to the wrangling_guidelines page And I follow "Intro and General Concepts" Then I should see "This series of documents (Wrangling Guidelines) are intended to help tag wranglers remain consistent as they go about the business of wrangling tags by providing a set of formatting guidelines." within ".userstuff" + And the page title should include "Intro and General Concepts" Scenario: Edit Wrangling Guideline diff --git a/spec/controllers/wrangling_guidelines_controller_spec.rb b/spec/controllers/wrangling_guidelines_controller_spec.rb index c66430023a..cca4294061 100644 --- a/spec/controllers/wrangling_guidelines_controller_spec.rb +++ b/spec/controllers/wrangling_guidelines_controller_spec.rb @@ -26,6 +26,11 @@ expect(response).to render_template("show") expect(assigns(:wrangling_guideline)).to eq(guideline) end + + it "assigns page subtitle using guideline title" do + get :show, params: { id: guideline.id } + expect(assigns[:page_subtitle]).to eq(guideline.title) + end end describe "GET #new" do