From db3c325949e32307ba420f8a6a7f93c17c09a335 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 19 Jul 2013 16:13:44 -0300 Subject: [PATCH] rails3: Rails.root is not a string anymore --- test/unit/layout_template_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/layout_template_test.rb b/test/unit/layout_template_test.rb index f9079b3..ecba6c5 100644 --- a/test/unit/layout_template_test.rb +++ b/test/unit/layout_template_test.rb @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../test_helper' class LayoutTemplateTest < ActiveSupport::TestCase should 'read configuration' do - YAML.expects(:load_file).with(Rails.root + '/public/designs/templates/default/config.yml').returns({'number_of_boxes' => 3, 'description' => 'my description', 'title' => 'my title'}) + YAML.expects(:load_file).with(File.join(Rails.root, 'public/designs/templates/default/config.yml')).returns({'number_of_boxes' => 3, 'description' => 'my description', 'title' => 'my title'}) t = LayoutTemplate.find('default') assert_equal 3, t.number_of_boxes assert_equal 'my description', t.description @@ -11,9 +11,9 @@ class LayoutTemplateTest < ActiveSupport::TestCase end should 'list all' do - Dir.expects(:glob).with(Rails.root + '/public/designs/templates/*').returns([Rails.root + '/public/designs/templates/one', Rails.root + '/public/designs/templates/two']) - YAML.expects(:load_file).with(Rails.root + '/public/designs/templates/one/config.yml').returns({}) - YAML.expects(:load_file).with(Rails.root + '/public/designs/templates/two/config.yml').returns({}) + Dir.expects(:glob).with(File.join(Rails.root, 'public/designs/templates/*')).returns([File.join(Rails.root, 'public/designs/templates/one'), File.join(Rails.root, 'public/designs/templates/two')]) + YAML.expects(:load_file).with(File.join(Rails.root, 'public/designs/templates/one/config.yml')).returns({}) + YAML.expects(:load_file).with(File.join(Rails.root, 'public/designs/templates/two/config.yml')).returns({}) all = LayoutTemplate.all assert_equivalent [ 'one', 'two' ], all.map(&:id) -- libgit2 0.21.2