aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_holidays_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-11-28 16:38:23 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-15 18:04:22 +0000
commit46b48f4283332e2f6229641cbf2e0f6b3e57404c (patch)
tree5fac684bd732f7138f949b6056b0bd33ecf5561c /spec/controllers/admin_holidays_controller_spec.rb
parentbe43f90852304793642ea752c358aebaf6f7bef1 (diff)
Add basic destroy action.
Diffstat (limited to 'spec/controllers/admin_holidays_controller_spec.rb')
-rw-r--r--spec/controllers/admin_holidays_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/controllers/admin_holidays_controller_spec.rb b/spec/controllers/admin_holidays_controller_spec.rb
index 7025daa81..087a77b32 100644
--- a/spec/controllers/admin_holidays_controller_spec.rb
+++ b/spec/controllers/admin_holidays_controller_spec.rb
@@ -85,4 +85,29 @@ describe AdminHolidaysController do
end
+ describe :destroy do
+
+ before(:each) do
+ @holiday = FactoryGirl.create(:holiday)
+ delete :destroy, :id => @holiday.id
+ end
+
+ it 'finds the holiday to destroy' do
+ assigns(:holiday).should == @holiday
+ end
+
+ it 'destroys the holiday' do
+ assigns(:holiday).should be_destroyed
+ end
+
+ it 'tells the admin the holiday has been destroyed' do
+ msg = "Holiday successfully destroyed"
+ flash[:notice].should == msg
+ end
+
+ it 'redirects to the index action' do
+ expect(response).to redirect_to(admin_holidays_path)
+ end
+ end
+
end