Skip to content

Commit

Permalink
Merge pull request #3012 from tvdeyen/fix-messages-controller
Browse files Browse the repository at this point in the history
Set Alchemy::Page.current in Messages Controller
  • Loading branch information
tvdeyen authored Sep 3, 2024
2 parents 3e82952 + 19b2b34 commit a13577a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/alchemy/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/alchemy/messages_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a13577a

Please sign in to comment.