diff --git a/app/views/doc/topic.html.erb b/app/views/doc/topic.html.erb index 2d95f14..94cded6 100644 --- a/app/views/doc/topic.html.erb +++ b/app/views/doc/topic.html.erb @@ -1,2 +1,2 @@ <%= render :partial => 'toc' %> -<%= display_doc @topic.html %> +<%= display_doc @topic.html(environment.theme) %> diff --git a/test/functional/doc_controller_test.rb b/test/functional/doc_controller_test.rb index b03644a..0d68b18 100644 --- a/test/functional/doc_controller_test.rb +++ b/test/functional/doc_controller_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require File.dirname(__FILE__) + '/../test_helper' class DocControllerTest < ActionController::TestCase @@ -40,6 +40,15 @@ class DocControllerTest < ActionController::TestCase assert_equal 'pt', assigns(:topic).language end + should 'use environment theme' do + e = Environment.default + e.theme = 'test-theme' + e.save + + DocTopic.any_instance.expects(:html).with('test-theme') + get :topic, :section => 'user', :topic => 'accepting-friends' + end + should 'bail out gracefully for unexisting sections or topics' do assert_nothing_raised do get :section, :section => 'something-very-unlikely' -- libgit2 0.21.2