Commit b51b35d703235d5fe2d7c8977d68faa80e5eafde

Authored by Diego Camarinha
Committed by Rafael Manzo
1 parent 2dbd2848

Missing mock on Metric Configuration controller fixed.

Fixed scenario of range creation feature.

signed-off-by: Renan Fichberg <rfichberg@gmail.com>
features/mezuro_range/create.feature
... ... @@ -51,7 +51,6 @@ Feature: Create range
51 51 And I should see "You must have readings in your associated reading group to create a new range."
52 52 When I click the Create New Reading link
53 53 Then I should be at the New Reading page
54   - And I take a picture of the page
55 54 And I should see "Label"
56 55 And I should see "Grade"
57 56 And I should see "Color"
... ...
spec/controllers/metric_configurations_controller_spec.rb
... ... @@ -88,9 +88,13 @@ describe MetricConfigurationsController do
88 88 describe 'show' do
89 89 let(:metric_configuration) { FactoryGirl.build(:metric_configuration) }
90 90 let(:reading_group) { FactoryGirl.build(:reading_group) }
  91 + let(:mezuro_range) { FactoryGirl.build(:mezuro_range) }
  92 +
91 93 before :each do
92 94 ReadingGroup.expects(:find).with(metric_configuration.reading_group_id).returns(reading_group)
93 95 MetricConfiguration.expects(:find).with(metric_configuration.id).returns(metric_configuration)
  96 + MezuroRange.expects(:ranges_of).with(metric_configuration.id).returns([mezuro_range])
  97 +
94 98 get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id
95 99 end
96 100  
... ...