Commit 39c96ce1c81bdb98b32b7e01a93fc5424ab1fd8f
Committed by
Heitor
1 parent
c1f1a609
Exists in
colab
and in
4 other branches
Fix CompoundMetricController cache expiration
The search and replace missed this. Now when a new CompoundMetriConfiguration gets created or updated the KalibroConfiguration show page gets a clear cache. Signed off by: Heitor Reis <marcheing@gmail.com>
Showing
3 changed files
with
5 additions
and
4 deletions
Show diff stats
app/controllers/compound_metric_configurations_controller.rb
| ... | ... | @@ -7,7 +7,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle |
| 7 | 7 | respond_to do |format| |
| 8 | 8 | create_and_redir(format) |
| 9 | 9 | end |
| 10 | - Rails.cache.delete("#{params[:kalibro_configuration_id].to_i}_metric_configurations") | |
| 10 | + Rails.cache.delete("#{params[:kalibro_configuration_id].to_i}_tree_metric_configurations") | |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | def show |
| ... | ... | @@ -30,7 +30,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle |
| 30 | 30 | else |
| 31 | 31 | failed_action(format, 'edit') |
| 32 | 32 | end |
| 33 | - Rails.cache.delete("#{@compound_metric_configuration.kalibro_configuration_id}_metric_configurations") | |
| 33 | + Rails.cache.delete("#{@compound_metric_configuration.kalibro_configuration_id}_tree_metric_configurations") | |
| 34 | 34 | end |
| 35 | 35 | end |
| 36 | 36 | ... | ... |
features/compound_metric_configuration/create.feature
| ... | ... | @@ -3,7 +3,7 @@ Feature: Compound Metric Configuration Creation |
| 3 | 3 | As a regular user |
| 4 | 4 | I should be able to create compound metric configurations |
| 5 | 5 | |
| 6 | - @kalibro_configuration_restart @javascript @wip | |
| 6 | + @kalibro_configuration_restart @javascript | |
| 7 | 7 | Scenario: compound metric configuration creation |
| 8 | 8 | Given I am a regular user |
| 9 | 9 | And I am signed in | ... | ... |
spec/controllers/compound_metric_configurations_controller_spec.rb
| ... | ... | @@ -43,6 +43,7 @@ describe CompoundMetricConfigurationsController, :type => :controller do |
| 43 | 43 | context 'when the current user owns the reading group' do |
| 44 | 44 | before :each do |
| 45 | 45 | subject.expects(:kalibro_configuration_owner?).returns true |
| 46 | + Rails.cache.expects(:delete).with("#{kalibro_configuration.id}_tree_metric_configurations") | |
| 46 | 47 | end |
| 47 | 48 | |
| 48 | 49 | context 'with valid fields' do |
| ... | ... | @@ -134,6 +135,7 @@ describe CompoundMetricConfigurationsController, :type => :controller do |
| 134 | 135 | context 'when user owns the metric configuration' do |
| 135 | 136 | before :each do |
| 136 | 137 | subject.expects(:metric_configuration_owner?).returns true |
| 138 | + Rails.cache.expects(:delete).with("#{kalibro_configuration.id}_tree_metric_configurations") | |
| 137 | 139 | end |
| 138 | 140 | |
| 139 | 141 | context 'with valid fields' do |
| ... | ... | @@ -170,5 +172,4 @@ describe CompoundMetricConfigurationsController, :type => :controller do |
| 170 | 172 | end |
| 171 | 173 | end |
| 172 | 174 | end |
| 173 | - | |
| 174 | 175 | end | ... | ... |