From 781ee37c28bf1137df0574e29de710490588eb43 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 13 Feb 2014 22:30:20 -0300 Subject: [PATCH] themes-controller-test: test themes are not duplicated when allowed by the environment and by the user --- test/functional/themes_controller_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/test/functional/themes_controller_test.rb b/test/functional/themes_controller_test.rb index 6574fd1..82934b4 100644 --- a/test/functional/themes_controller_test.rb +++ b/test/functional/themes_controller_test.rb @@ -308,4 +308,14 @@ class ThemesControllerTest < ActionController::TestCase assert_no_tag :content => "Select theme" end + should 'not duplicate themes that are included by the user and by the environment' do + t1 = Theme.create('theme1') + t2 = Theme.create('theme2') + Environment.any_instance.stubs('themes').returns([t1,t2]) + Theme.stubs(:approved_themes).returns([t2]) + + get :index, :profile => "testinguser" + assert_equivalent [t1, t2], assigns(:themes) + end + end -- libgit2 0.21.2