summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/content_controller.rb2
-rw-r--r--test/controllers/content_controller_test.rb10
2 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb
index 8d33105..8be4bfb 100644
--- a/app/controllers/content_controller.rb
+++ b/app/controllers/content_controller.rb
@@ -31,7 +31,7 @@ class ContentController < ApplicationController
31 def render_gallery 31 def render_gallery
32 unless @page.nil? 32 unless @page.nil?
33 @images = @page.assets.images 33 @images = @page.assets.images
34 render :file => "content/gallery" 34 render :template => 'content/gallery'
35 else 35 else
36 head :not_found 36 head :not_found
37 end 37 end
diff --git a/test/controllers/content_controller_test.rb b/test/controllers/content_controller_test.rb
index 2449a0c..9731d08 100644
--- a/test/controllers/content_controller_test.rb
+++ b/test/controllers/content_controller_test.rb
@@ -104,6 +104,16 @@ class ContentControllerTest < ActionController::TestCase
104 assert_response :success 104 assert_response :success
105 File.write("/tmp/no_fill_response.html", @response.body) 105 File.write("/tmp/no_fill_response.html", @response.body)
106 end 106 end
107
108 test "render_gallery renders for a published page" do
109 node = Node.root.children.create!(:slug => "gallery_render_test")
110 Globalize.with_locale(I18n.default_locale) { node.draft.update!(:title => "Galerie") }
111 node.publish_draft!
112
113 get :render_gallery, params: { :page_path => "gallery_render_test", :locale => "de" }
114
115 assert_response :success
116 end
107 117
108 protected 118 protected
109 119