diff --git a/app/controllers/alchemy/messages_controller.rb b/app/controllers/alchemy/messages_controller.rb index 321d3e5e64..b84ac401d2 100644 --- a/app/controllers/alchemy/messages_controller.rb +++ b/app/controllers/alchemy/messages_controller.rb @@ -66,6 +66,7 @@ def create # :nodoc: MessagesMailer.contact_form_mail(@message, mail_to, mail_from, subject).deliver redirect_to_success_page else + Current.page = @page render template: "alchemy/pages/show" end end diff --git a/spec/controllers/alchemy/messages_controller_spec.rb b/spec/controllers/alchemy/messages_controller_spec.rb index 72a10bc7ec..26aa25004c 100644 --- a/spec/controllers/alchemy/messages_controller_spec.rb +++ b/spec/controllers/alchemy/messages_controller_spec.rb @@ -56,6 +56,11 @@ module Alchemy it "should render 'alchemy/pages/show' template" do expect(subject).to render_template("alchemy/pages/show") end + + it "assigns Alchemy::Page.current" do + expect(Alchemy::Current).to receive(:page=).with(page) + subject + end end context "succeeded" do