Generate Ability Test/Spec File #350

Closed
ryanb opened this Issue Apr 21, 2011 · 0 comments

Projects

None yet

1 participant

Owner
ryanb commented Apr 21, 2011

The cancan:ability generator should create a test/spec file to encourage testing of the Ability class. It could contain something like this.

require "spec_helper"
require "cancan/matchers"

describe "Ability" do
  describe "as guest" do
    before(:each) do
      @ability = Ability.new(nil)
    end

    it "can only create a user" do
      # Define what a guest can and cannot do
      # @ability.should be_able_to(:create, :users)
      # @ability.should_not be_able_to(:update, :users)
    end
  end
end
@ryanb ryanb closed this in 6c1d685 Sep 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment