I'm a little new to RSpec tests, and I'm trying to run some controller tests in my Rails 3 application using RSpec 2 and Authlogic 3 authentication.
Following the instructions provided by the Authlogic documentation ( http://rdoc.info/github/binarylogic/authlogic/master/Authlogic/TestCase ), I received the following codes in my files:
spec_helper.rb
require "authlogic/test_case"
events_controller_spec.rb
require 'spec_helper'
setup :activate_authlogic
Running tests through rake spec SPEC='spec/controllers/eventos_controller_spec.rb'I received the following error:
events_controller_spec.rb:2: undefined method `setup' for main:Object (NoMethodError)
When I ran the tests before using authlogic, I had no problems.
I am using Ubuntu 11.04 and this configuration:
ruby - 1.8.7
rails - 3.0.7
authlogic - 3.0.2
rspec-rails - 2.4.1
factory_girl_rails - 1.0.1
source
share