Commit b9d699da2bb80ed35aae9220f382bc5628267d5b
1 parent
29c00b6f
Exists in
colab
and in
4 other branches
Added missing mock to compound metric configuration
signed-off-by: Pedro Vezza <pedro@vezza.com.br>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
spec/controllers/compound_metric_configurations_controller_spec.rb
| ... | ... | @@ -126,7 +126,6 @@ describe CompoundMetricConfigurationsController, :type => :controller do |
| 126 | 126 | let(:compound_metric_configuration) { FactoryGirl.build(:compound_metric_configuration) } |
| 127 | 127 | let(:metric_configuration_params) { Hash[FactoryGirl.attributes_for(:compound_metric_configuration).map { |k,v| [k.to_s, v.to_s] }] } #FIXME: Mocha is creating the expectations with strings, but FactoryGirl returns everything with sybols and integers |
| 128 | 128 | |
| 129 | - | |
| 130 | 129 | context 'when the user is logged in' do |
| 131 | 130 | before do |
| 132 | 131 | sign_in FactoryGirl.create(:user) |
| ... | ... | @@ -152,6 +151,7 @@ describe CompoundMetricConfigurationsController, :type => :controller do |
| 152 | 151 | context 'with an invalid field' do |
| 153 | 152 | before :each do |
| 154 | 153 | MetricConfiguration.expects(:find).at_least_once.with(compound_metric_configuration.id).returns(compound_metric_configuration) |
| 154 | + MetricConfiguration.expects(:metric_configurations_of).with(mezuro_configuration.id).returns([compound_metric_configuration]) | |
| 155 | 155 | MetricConfiguration.any_instance.expects(:update).with(metric_configuration_params).returns(false) |
| 156 | 156 | |
| 157 | 157 | post :update, mezuro_configuration_id: compound_metric_configuration.configuration_id, id: compound_metric_configuration.id, metric_configuration: metric_configuration_params | ... | ... |