Commit b51b35d703235d5fe2d7c8977d68faa80e5eafde
Committed by
Rafael Manzo
1 parent
2dbd2848
Exists in
colab
and in
4 other branches
Missing mock on Metric Configuration controller fixed.
Fixed scenario of range creation feature. signed-off-by: Renan Fichberg <rfichberg@gmail.com>
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
features/mezuro_range/create.feature
| @@ -51,7 +51,6 @@ Feature: Create range | @@ -51,7 +51,6 @@ Feature: Create range | ||
| 51 | And I should see "You must have readings in your associated reading group to create a new range." | 51 | And I should see "You must have readings in your associated reading group to create a new range." |
| 52 | When I click the Create New Reading link | 52 | When I click the Create New Reading link |
| 53 | Then I should be at the New Reading page | 53 | Then I should be at the New Reading page |
| 54 | - And I take a picture of the page | ||
| 55 | And I should see "Label" | 54 | And I should see "Label" |
| 56 | And I should see "Grade" | 55 | And I should see "Grade" |
| 57 | And I should see "Color" | 56 | And I should see "Color" |
spec/controllers/metric_configurations_controller_spec.rb
| @@ -88,9 +88,13 @@ describe MetricConfigurationsController do | @@ -88,9 +88,13 @@ describe MetricConfigurationsController do | ||
| 88 | describe 'show' do | 88 | describe 'show' do |
| 89 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } | 89 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } |
| 90 | let(:reading_group) { FactoryGirl.build(:reading_group) } | 90 | let(:reading_group) { FactoryGirl.build(:reading_group) } |
| 91 | + let(:mezuro_range) { FactoryGirl.build(:mezuro_range) } | ||
| 92 | + | ||
| 91 | before :each do | 93 | before :each do |
| 92 | ReadingGroup.expects(:find).with(metric_configuration.reading_group_id).returns(reading_group) | 94 | ReadingGroup.expects(:find).with(metric_configuration.reading_group_id).returns(reading_group) |
| 93 | MetricConfiguration.expects(:find).with(metric_configuration.id).returns(metric_configuration) | 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 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id | 98 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id |
| 95 | end | 99 | end |
| 96 | 100 |