From 16d7dc3ca439e34dfd8c6119c4b11bfcbf6e3ee4 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Thu, 25 Feb 2010 21:13:59 -0300 Subject: [PATCH] Adding parameter to use theme images on documentation --- app/views/doc/topic.html.erb | 2 +- test/functional/doc_controller_test.rb | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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