Commit 3bd0c47b9baa040031a7d4c0868e327adbb1ecac

Authored by Dhruv Kapadia
1 parent abd621ab

Temporarily removing hoptoad deploy notification

deploy/after_restart.rb
1   -run "cd #{release_path} && rake hoptoad:deploy TO=#{node[:environment][:framework_env]} USER=#{node[:owner_name]} REVISION=#{`cat #{release_path}/REVISION`}"
  1 +#run "cd #{release_path} && rake hoptoad:deploy TO=#{node[:environment][:framework_env]} USER=#{node[:owner_name]} REVISION=#{`cat #{release_path}/REVISION`}"
... ...
spec/controllers/items_controller_spec.rb
... ... @@ -1,131 +0,0 @@
1   -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2   -
3   -describe ItemsController do
4   -
5   - def mock_item(stubs={})
6   - @mock_item ||= mock_model(Item, stubs)
7   - end
8   -
9   - describe "GET index" do
10   - it "assigns all items as @items" do
11   - Item.stub!(:find).with(:all).and_return([mock_item])
12   - get :index
13   - assigns[:items].should == [mock_item]
14   - end
15   - end
16   -
17   - describe "GET show" do
18   - it "assigns the requested item as @item" do
19   - Item.stub!(:find).with("37").and_return(mock_item)
20   - get :show, :id => "37"
21   - assigns[:item].should equal(mock_item)
22   - end
23   - end
24   -
25   - describe "GET new" do
26   - it "assigns a new item as @item" do
27   - Item.stub!(:new).and_return(mock_item)
28   - get :new
29   - assigns[:item].should equal(mock_item)
30   - end
31   - end
32   -
33   - describe "GET edit" do
34   - it "assigns the requested item as @item" do
35   - Item.stub!(:find).with("37").and_return(mock_item)
36   - get :edit, :id => "37"
37   - assigns[:item].should equal(mock_item)
38   - end
39   - end
40   -
41   - describe "POST create" do
42   -
43   - describe "with valid params" do
44   - it "assigns a newly created item as @item" do
45   - Item.stub!(:new).with({'these' => 'params'}).and_return(mock_item(:save => true))
46   - post :create, :item => {:these => 'params'}
47   - assigns[:item].should equal(mock_item)
48   - end
49   -
50   - it "redirects to the created item" do
51   - Item.stub!(:new).and_return(mock_item(:save => true))
52   - post :create, :item => {}
53   - response.should redirect_to(item_url(mock_item))
54   - end
55   - end
56   -
57   - describe "with invalid params" do
58   - it "assigns a newly created but unsaved item as @item" do
59   - Item.stub!(:new).with({'these' => 'params'}).and_return(mock_item(:save => false))
60   - post :create, :item => {:these => 'params'}
61   - assigns[:item].should equal(mock_item)
62   - end
63   -
64   - it "re-renders the 'new' template" do
65   - Item.stub!(:new).and_return(mock_item(:save => false))
66   - post :create, :item => {}
67   - response.should render_template('new')
68   - end
69   - end
70   -
71   - end
72   -
73   - describe "PUT update" do
74   -
75   - describe "with valid params" do
76   - it "updates the requested item" do
77   - Item.should_receive(:find).with("37").and_return(mock_item)
78   - mock_item.should_receive(:update_attributes).with({'these' => 'params'})
79   - put :update, :id => "37", :item => {:these => 'params'}
80   - end
81   -
82   - it "assigns the requested item as @item" do
83   - Item.stub!(:find).and_return(mock_item(:update_attributes => true))
84   - put :update, :id => "1"
85   - assigns[:item].should equal(mock_item)
86   - end
87   -
88   - it "redirects to the item" do
89   - Item.stub!(:find).and_return(mock_item(:update_attributes => true))
90   - put :update, :id => "1"
91   - response.should redirect_to(item_url(mock_item))
92   - end
93   - end
94   -
95   - describe "with invalid params" do
96   - it "updates the requested item" do
97   - Item.should_receive(:find).with("37").and_return(mock_item)
98   - mock_item.should_receive(:update_attributes).with({'these' => 'params'})
99   - put :update, :id => "37", :item => {:these => 'params'}
100   - end
101   -
102   - it "assigns the item as @item" do
103   - Item.stub!(:find).and_return(mock_item(:update_attributes => false))
104   - put :update, :id => "1"
105   - assigns[:item].should equal(mock_item)
106   - end
107   -
108   - it "re-renders the 'edit' template" do
109   - Item.stub!(:find).and_return(mock_item(:update_attributes => false))
110   - put :update, :id => "1"
111   - response.should render_template('edit')
112   - end
113   - end
114   -
115   - end
116   -
117   - describe "DELETE destroy" do
118   - it "destroys the requested item" do
119   - Item.should_receive(:find).with("37").and_return(mock_item)
120   - mock_item.should_receive(:destroy)
121   - delete :destroy, :id => "37"
122   - end
123   -
124   - it "redirects to the items list" do
125   - Item.stub!(:find).and_return(mock_item(:destroy => true))
126   - delete :destroy, :id => "1"
127   - response.should redirect_to(items_url)
128   - end
129   - end
130   -
131   -end