ruby on rails 3 - cancan Abilty, Devise and Rspec testing -



ruby on rails 3 - cancan Abilty, Devise and Rspec testing -

people, i'm new @ ror enviroment, , i'm trying apparently simple, getting complicated.

i not have roles in application, , want add together features logged in users, starting rspec tests, cannot find way test if user signed in...

i'm using cancan devise.

i tried code below, didn't work, says there no method called sign_in, i've tried current_user, , user_signed_in?

before(:each) @user = user.new sign_in @user end

what missing?

gemfile:

source 'http://rubygems.org' gem 'rails', '~> 3.0.7' # authentication gem 'devise', '~> 1.3.4' #authorization gem "cancan" # mongodb database gem 'mongoid', '~> 2.0' gem 'bson_ext', '~> 1.3' gem "high_voltage" gem 'translate_routes' gem 'factory_girl_rails', "~> 1.1.rc1" grouping :development, :test gem "rspec-rails", ">= 2.0.0" gem "cucumber-rails", ">= 0.3.2" gem "webrat", ">= 0.7.2" gem 'rspec', '2.5.0' gem 'spork' gem 'launchy' gem 'autotest' gem 'autotest-rails-pure' gem 'ruby-debug' gem 'rake', '0.9.2' gem 'shoulda' end

do have spec/support/devise.rb file? needs include

rspec.configure |config| config.include devise::testhelpers, :type => :controller end

ruby-on-rails-3 rspec devise cancan

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -