Commit 108b8cece3605c40ba7fedbb4089d1c1eba07ac1
Committed by
Rafael Manzo
1 parent
8c234ac7
Exists in
colab
and in
4 other branches
Routing to create new compound metric
signed-off-by: Diego Araújo <diegoamc90@gmail.com>
Showing
3 changed files
with
6 additions
and
1 deletions
Show diff stats
app/views/metric_configurations/choose_metric.html.erb
... | ... | @@ -11,7 +11,9 @@ |
11 | 11 | <% end %> |
12 | 12 | </div> |
13 | 13 | <% end %> |
14 | -</div> | |
14 | +</div><br /> | |
15 | + | |
16 | +<%= link_to 'Compound Metric', mezuro_configuration_new_compound_metric_path(@mezuro_configuration_id), class: 'btn btn-default' %> | |
15 | 17 | |
16 | 18 | <script type="text/javascript"> |
17 | 19 | //Loads the accordion | ... | ... |
config/routes.rb
... | ... | @@ -12,6 +12,7 @@ Mezuro::Application.routes.draw do |
12 | 12 | |
13 | 13 | resources :mezuro_configurations do |
14 | 14 | get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric |
15 | + get '/new_compound_metric' => 'metric_configurations#new_compound_metric', as: :new_compound_metric | |
15 | 16 | resources :metric_configurations, except: [:update, :new] |
16 | 17 | get '/metric_configurations/:metric_name/:base_tool_name/new' => 'metric_configurations#new', as: :new_metric_configuration |
17 | 18 | put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update | ... | ... |
spec/routing/metric_configurations_routing_spec.rb
... | ... | @@ -6,6 +6,8 @@ describe MetricConfigurationsController do |
6 | 6 | to(controller: :metric_configurations, action: :new, mezuro_configuration_id: "1", metric_name: "LOC", base_tool_name: "Analizo") } |
7 | 7 | it { should route(:get, '/mezuro_configurations/1/metric_configurations'). |
8 | 8 | to(controller: :metric_configurations, action: :index, mezuro_configuration_id: "1") } |
9 | + it { should route(:get, '/mezuro_configurations/1/new_compound_metric'). | |
10 | + to(controller: :metric_configurations, action: :new_compound_metric, mezuro_configuration_id: "1") } | |
9 | 11 | it { should route(:post, '/mezuro_configurations/1/metric_configurations'). |
10 | 12 | to(controller: :metric_configurations, action: :create, mezuro_configuration_id: "1") } |
11 | 13 | it { should route(:get, '/mezuro_configurations/1/metric_configurations/1'). | ... | ... |