Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed group controller test. Fixed problem with tests in environment.rb

  • Loading branch information...
commit 34e50abf5cee5abf5b2e1e1df488c45305b96300 1 parent 056437d
@jbasdf authored
Showing with 13 additions and 6 deletions.
  1. +3 −1 config/environment.rb
  2. +10 −5 test/functional/groups_controller_test.rb
View
4 config/environment.rb
@@ -104,7 +104,9 @@
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector
- if ENV["DB_MIGRATION"] != "true"
+ # Have to turn off observers when using Rake. However, it is important to
+ # make sure the observers are turned on when running rake, rake test, etc
+ if ENV["DB_MIGRATION"] != "true" || Rails.env == 'test'
config.active_record.observers = :user_observer, :user_plone_observer
end
View
15 test/functional/groups_controller_test.rb
@@ -171,11 +171,16 @@ def self.should_deny_group_admin_actions(name)
end
- should "delete a group" do
- assert_difference "Group.count", -1 do
- group = Factory(:group, :creator => @admin_user)
- delete :destroy, { :id => group.to_param }
- assert_redirected_to groups_url
+ context "DELETE to destroy" do
+ setup do
+ @group = Factory(:group, :creator => @admin_user)
+ end
+
+ should "delete a group" do
+ assert_difference "Group.count", -1 do
+ delete :destroy, { :id => @group.to_param }
+ assert_redirected_to groups_url
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.