Commit 16d7dc3ca439e34dfd8c6119c4b11bfcbf6e3ee4
Committed by
Joenio Costa
1 parent
6e67250f
Exists in
master
and in
23 other branches
Adding parameter to use theme images on documentation
(ActionItem1410)
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
app/views/doc/topic.html.erb
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 < 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' | ... | ... |