Commit db99ef65b0cb026d8fefae9dac24f8648bc8afd6
Committed by
Rafael Manzo
1 parent
83655306
Exists in
colab
and in
4 other branches
Routes & its unit test for ranges
Signed off by: Fellipe Souto Sampaio <fllsouto@gmail.com>
Showing
3 changed files
with
51 additions
and
1 deletions
Show diff stats
... | ... | @@ -0,0 +1,26 @@ |
1 | +include OwnershipAuthentication | |
2 | + | |
3 | +class MezuroRangesController < ApplicationController | |
4 | + | |
5 | +def show | |
6 | +end | |
7 | + | |
8 | +def create | |
9 | +end | |
10 | + | |
11 | +def destroy | |
12 | +end | |
13 | + | |
14 | +def update | |
15 | +end | |
16 | + | |
17 | +def index | |
18 | +end | |
19 | + | |
20 | +def edit | |
21 | +end | |
22 | + | |
23 | +def new | |
24 | +end | |
25 | + | |
26 | +end | |
0 | 27 | \ No newline at end of file | ... | ... |
config/routes.rb
... | ... | @@ -12,7 +12,11 @@ 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 | - resources :metric_configurations, except: [:update, :new] | |
15 | + resources :metric_configurations, except: [:update, :new] do | |
16 | + get '/mezuro_ranges/new' => 'mezuro_ranges#new', as: :new_mezuro_range | |
17 | + resources :mezuro_ranges, except: [:update, :new] | |
18 | + put '/mezuro_ranges/:id' => 'mezuro_ranges#update', as: :mezuro_range_update | |
19 | + end | |
16 | 20 | get '/metric_configurations/:metric_name/:base_tool_name/new' => 'metric_configurations#new', as: :new_metric_configuration |
17 | 21 | put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update |
18 | 22 | ... | ... |
... | ... | @@ -0,0 +1,20 @@ |
1 | +require "spec_helper" | |
2 | + | |
3 | +describe MezuroRangesController do | |
4 | + describe "routing" do | |
5 | + it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). | |
6 | + to(controller: :mezuro_ranges, action: :index, mezuro_configuration_id: "1", metric_configuration_id: "1") } | |
7 | + it { should route(:post, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). | |
8 | + to(controller: :mezuro_ranges, action: :create, mezuro_configuration_id: "1", metric_configuration_id: "1") } | |
9 | + it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1/edit'). | |
10 | + to(controller: :mezuro_ranges, action: :edit, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | |
11 | + it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | |
12 | + to(controller: :mezuro_ranges, action: :show, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | |
13 | + it { should route(:delete, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | |
14 | + to(controller: :mezuro_ranges, action: :destroy, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | |
15 | + it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/new'). | |
16 | + to(controller: :mezuro_ranges, action: :new, mezuro_configuration_id: "1", metric_configuration_id: "1") } | |
17 | + it { should route(:put, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | |
18 | + to(controller: :mezuro_ranges, action: :update, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | |
19 | + end | |
20 | +end | ... | ... |