BACKWARDS INCOMPATIBLE: use Ability#initialize instead of 'prepare' to set up abilities - closes #4

This commit is contained in:
Ryan Bates
2009-11-17 10:25:47 -08:00
parent 9d58226563
commit 1edf583110
6 changed files with 17 additions and 20 deletions

View File

@@ -78,7 +78,7 @@ describe CanCan::Ability do
@ability.can?(:edit, 123).should == :update_called
end
it "should respond to prepare" do
@ability.should respond_to(:prepare)
it "should not respond to prepare (now using initialize)" do
@ability.should_not respond_to(:prepare)
end
end

View File

@@ -2,6 +2,9 @@ require File.dirname(__FILE__) + '/../spec_helper'
class Ability
include CanCan::Ability
def initialize(user)
end
end
describe CanCan::ControllerAdditions do