Commit 16d7dc3ca439e34dfd8c6119c4b11bfcbf6e3ee4

Authored by Daniela Feitosa
Committed by Joenio Costa
1 parent 6e67250f

Adding parameter to use theme images on documentation

(ActionItem1410)
app/views/doc/topic.html.erb
1 1 <%= render :partial => 'toc' %>
2   -<%= display_doc @topic.html %>
  2 +<%= display_doc @topic.html(environment.theme) %>
... ...
test/functional/doc_controller_test.rb
1   -require 'test_helper'
  1 +require File.dirname(__FILE__) + '/../test_helper'
2 2  
3 3 class DocControllerTest < ActionController::TestCase
4 4  
... ... @@ -40,6 +40,15 @@ class DocControllerTest &lt; ActionController::TestCase
40 40 assert_equal 'pt', assigns(:topic).language
41 41 end
42 42  
  43 + should 'use environment theme' do
  44 + e = Environment.default
  45 + e.theme = 'test-theme'
  46 + e.save
  47 +
  48 + DocTopic.any_instance.expects(:html).with('test-theme')
  49 + get :topic, :section => 'user', :topic => 'accepting-friends'
  50 + end
  51 +
43 52 should 'bail out gracefully for unexisting sections or topics' do
44 53 assert_nothing_raised do
45 54 get :section, :section => 'something-very-unlikely'
... ...