Commit 149734b607e7dddf33645f1ae2ae3887c35431f8
Committed by
Caio
1 parent
bedd4efd
Exists in
master
and in
29 other branches
[Mezuro] fixed functional tests
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
@@ -19,10 +19,9 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | @@ -19,10 +19,9 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | ||
19 | @module_result = ModuleResultFixtures.create | 19 | @module_result = ModuleResultFixtures.create |
20 | @project = @project_result.project | 20 | @project = @project_result.project |
21 | @name = @project.name | 21 | @name = @project.name |
22 | - | 22 | + |
23 | @date = "2012-04-13T20:39:41+04:00" | 23 | @date = "2012-04-13T20:39:41+04:00" |
24 | 24 | ||
25 | - @date = "2012-04-13T20:39:41+04:00" | ||
26 | end | 25 | end |
27 | 26 | ||
28 | should 'not find project state for inexistent project content' do | 27 | should 'not find project state for inexistent project content' do |
@@ -146,15 +145,19 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | @@ -146,15 +145,19 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | ||
146 | create_project_content | 145 | create_project_content |
147 | mock_module_result_history | 146 | mock_module_result_history |
148 | Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project) | 147 | Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project) |
149 | - get :module_metrics_history, :profile => @profile.identifier, :id => @content.id, :module_name => @name | 148 | + get :module_metrics_history, :profile => @profile.identifier, :id => @content.id, :module_name => @name, |
149 | + :metric_name => @module_result.metric_result.first.metric.name.delete("() ") | ||
150 | assert_response 200 | 150 | assert_response 200 |
151 | end | 151 | end |
152 | 152 | ||
153 | private | 153 | private |
154 | 154 | ||
155 | def create_project_content | 155 | def create_project_content |
156 | + client = mock | ||
156 | @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => @name) | 157 | @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => @name) |
157 | @content.expects(:send_project_to_service).returns(nil) | 158 | @content.expects(:send_project_to_service).returns(nil) |
159 | + Kalibro::Client::ProjectClient.expects(:new).returns(client) | ||
160 | + client.expects(:project_names).returns([]) | ||
158 | @content.save | 161 | @content.save |
159 | end | 162 | end |
160 | 163 |