From bfe651dd1748593f7dba77607f5f30a90003d79f Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Tue, 21 Jan 2014 10:44:35 -0200 Subject: [PATCH] Fixed let behaviour on ModulesController spec --- spec/controllers/modules_controller_spec.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/controllers/modules_controller_spec.rb b/spec/controllers/modules_controller_spec.rb index 2dbfc3f..c29085f 100644 --- a/spec/controllers/modules_controller_spec.rb +++ b/spec/controllers/modules_controller_spec.rb @@ -18,10 +18,9 @@ describe ModulesController do let (:metric_name ){ FactoryGirl.build(:loc).name } let (:date ){ DateTime.parse("2011-10-20T18:26:43.151+00:00") } let (:metric_result){ FactoryGirl.build(:metric_result) } - let (:module_result){ FactoryGirl.build(:module_result) } + let! (:module_result){ FactoryGirl.build(:module_result) } before :each do - module_result #TODO discover why this line is fundamental, without this line the test generates a nil object for module_result ModuleResult.expects(:new).at_least_once.with({id: module_result.id.to_s}).returns(module_result) module_result.expects(:metric_history).with(metric_name).returns({date => metric_result.value}) end @@ -46,9 +45,5 @@ describe ModulesController do @graphic.labels.first[1].should eq date.strftime("%Y/%m/%d") end end - - - - end end \ No newline at end of file -- libgit2 0.21.2