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