Commit bfe651dd1748593f7dba77607f5f30a90003d79f

Authored by Rafael Manzo
1 parent e41cf657

Fixed let behaviour on ModulesController spec

Signed off by: Guilherme Rojas V. de Lima <guilhermehrojas@gmail.com>
Showing 1 changed file with 1 additions and 6 deletions   Show diff stats
spec/controllers/modules_controller_spec.rb
... ... @@ -18,10 +18,9 @@ describe ModulesController do
18 18 let (:metric_name ){ FactoryGirl.build(:loc).name }
19 19 let (:date ){ DateTime.parse("2011-10-20T18:26:43.151+00:00") }
20 20 let (:metric_result){ FactoryGirl.build(:metric_result) }
21   - let (:module_result){ FactoryGirl.build(:module_result) }
  21 + let! (:module_result){ FactoryGirl.build(:module_result) }
22 22  
23 23 before :each do
24   - module_result #TODO discover why this line is fundamental, without this line the test generates a nil object for module_result
25 24 ModuleResult.expects(:new).at_least_once.with({id: module_result.id.to_s}).returns(module_result)
26 25 module_result.expects(:metric_history).with(metric_name).returns({date => metric_result.value})
27 26 end
... ... @@ -46,9 +45,5 @@ describe ModulesController do
46 45 @graphic.labels.first[1].should eq date.strftime("%Y/%m/%d")
47 46 end
48 47 end
49   -
50   -
51   -
52   -
53 48 end
54 49 end
55 50 \ No newline at end of file
... ...