Why am I getting an uninitialized constant error when trying to test cancan abilities in rspec?

Posted by midas06 on Stack Overflow See other posts from Stack Overflow or by midas06
Published on 2010-05-04T03:23:11Z Indexed on 2010/05/04 3:28 UTC
Read the original article Hit count: 445

I'm trying to test cancan abilities using rspec in rails 3 on ruby 1.8.7.

when i include the line: require 'cancan/matchers' in my spec file and run rake, i get:

.rvm/gems/ruby-1.8.7-p249/gems/cancan-1.1.1/lib/cancan/matchers.rb:1: uninitialized constant Spec (NameError) from ./spec/models/ability_spec.rb:3

How do i set up rspec and cancan correctly?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rspec