Commit b2503573a07f92ffb367cd5eacc2a9761b87c63d
1 parent
52d1958d
Exists in
colab
and in
4 other branches
Fixed CompoundMetricConfigurationsController#edit unit test without mock
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
spec/controllers/compound_metric_configurations_controller_spec.rb
| ... | ... | @@ -33,7 +33,6 @@ describe CompoundMetricConfigurationsController do |
| 33 | 33 | describe 'create' do |
| 34 | 34 | let!(:metric_configuration_params) { Hash[FactoryGirl.attributes_for(:metric_configuration).map { |k,v| [k.to_s, v.to_s] }] } #FIXME: Mocha is creating the expectations with strings, but FactoryGirl returns everything with symbols and integers |
| 35 | 35 | let!(:metric_params) { Hash[FactoryGirl.attributes_for(:metric).map { |k,v| [k.to_s, v.to_s] }] } #FIXME: Mocha is creating the expectations with strings, but FactoryGirl returns everything with symbols and integers |
| 36 | - let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } | |
| 37 | 36 | |
| 38 | 37 | before do |
| 39 | 38 | sign_in FactoryGirl.create(:user) |
| ... | ... | @@ -79,6 +78,7 @@ describe CompoundMetricConfigurationsController do |
| 79 | 78 | before :each do |
| 80 | 79 | subject.expects(:metric_configuration_owner?).returns(true) |
| 81 | 80 | MetricConfiguration.expects(:find).at_least_once.with(compound_metric_configuration.id).returns(compound_metric_configuration) |
| 81 | + MetricConfiguration.expects(:metric_configurations_of).with(mezuro_configuration.id).returns([compound_metric_configuration]) | |
| 82 | 82 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s |
| 83 | 83 | end |
| 84 | 84 | ... | ... |