forked from steamcannon/steamcannon
/
deployments_routing_spec.rb
59 lines (49 loc) · 2.67 KB
/
deployments_routing_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Copyright 2010 Red Hat, Inc.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
require 'spec_helper'
describe DeploymentsController do
describe "routing" do
it "recognizes and generates #index" do
{ :get => "/environments/1/deployments" }.should route_to(:controller => "deployments", :action => "index", :environment_id => '1')
end
it "recognizes and generates #new" do
{ :get => "/environments/1/deployments/new" }.should route_to(:controller => "deployments", :action => "new", :environment_id => '1')
end
it "recognizes and generates #show" do
{ :get => "/environments/1/deployments/1" }.should route_to(:controller => "deployments", :action => "show", :id => "1", :environment_id => '1')
end
it "recognizes and generates #edit" do
{ :get => "/environments/1/deployments/1/edit" }.should route_to(:controller => "deployments", :action => "edit", :id => "1", :environment_id => '1')
end
it "recognizes and generates #create" do
{ :post => "/environments/1/deployments" }.should route_to(:controller => "deployments", :action => "create", :environment_id => '1')
end
it "recognizes and generates #update" do
{ :put => "/environments/1/deployments/1" }.should route_to(:controller => "deployments", :action => "update", :id => "1", :environment_id => '1')
end
it "recognizes and generates #destroy" do
{ :delete => "/environments/1/deployments/1" }.should route_to(:controller => "deployments", :action => "destroy", :id => "1", :environment_id => '1')
end
it "recognizes and generates #undeploy" do
{ :post => '/environments/1/deployments/1/undeploy' }.should route_to(:controller => 'deployments', :action => 'undeploy', :id => '1', :environment_id => '1')
end
it "recognizes and generates #status" do
{ :post => '/environments/1/deployments/1/status' }.should route_to(:controller => 'deployments', :action => 'status', :id => '1', :environment_id => '1')
end
end
end