From df29ee59e5ec82efaea1c37455d0bcb04bd77115 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 4 Jul 2014 09:37:06 +0200 Subject: [PATCH] stubs settings in spec --- spec/models/backlog_spec.rb | 7 ++----- spec/models/burndown_spec.rb | 10 +++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/spec/models/backlog_spec.rb b/spec/models/backlog_spec.rb index a500cd5363..fa49fb5135 100644 --- a/spec/models/backlog_spec.rb +++ b/spec/models/backlog_spec.rb @@ -40,11 +40,8 @@ describe Backlog do before(:each) do @feature = FactoryGirl.create(:type_feature) - Setting.plugin_openproject_backlogs = { "points_burn_direction" => "down", - "wiki_template" => "", - "card_spec" => "Sattleford VM-5040", - "story_types" => [@feature.id.to_s], - "task_type" => "0" } + allow(Setting).to receive(:plugin_openproject_backlogs).and_return({ "story_types" => [@feature.id.to_s], + "task_type" => "0" }) @status = FactoryGirl.create(:status) end diff --git a/spec/models/burndown_spec.rb b/spec/models/burndown_spec.rb index 987a7337cb..55aed6b4dc 100644 --- a/spec/models/burndown_spec.rb +++ b/spec/models/burndown_spec.rb @@ -71,11 +71,11 @@ describe Burndown do User.stub(:current).and_return(user) - Setting.plugin_openproject_backlogs = {"points_burn_direction" => "down", - "wiki_template" => "", - "card_spec" => "Sattleford VM-5040", - "story_types" => [type_feature.id.to_s], - "task_type" => type_task.id.to_s } + allow(Setting).to receive(:plugin_openproject_backlogs).and_return({"points_burn_direction" => "down", + "wiki_template" => "", + "card_spec" => "Sattleford VM-5040", + "story_types" => [type_feature.id.to_s], + "task_type" => type_task.id.to_s }) project.save!