BACKWARDS INCOMPATIBLE: use Ability#initialize instead of 'prepare' to set up abilities - closes #4
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2,6 +2,9 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
||||
|
||||
class Ability
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
end
|
||||
end
|
||||
|
||||
describe CanCan::ControllerAdditions do
|
||||
|
||||
Reference in New Issue
Block a user