есть некоторый ressource на github How To: Test (devise) with Rails 3 and RSpec. , но как это очень высокий уровень, и я не могу заставить его работать в моем контексте. Каким образом можно подключить или сконфигурировать все эти части вместе, чтобы протестировать контроллер, требующий зарегистрированного пользователя (before_filter: authenticate_user!) ???проблема с factory_girl, devise, rpsec 2.0 и rails 3.0 => не может получить rspec для проверки контроллера
Сейчас я пытаюсь запустить RSpec на одном контроллере ..
require File.dirname(__FILE__) + '/../spec_helper'
describe ArticlesController do
fixtures :all
render_views
before (:each) do
@user = Factory.create(:user)
sign_in @user
end
it "index action should render index template" do
get :index
response.should render_template(:index)
end
end
здесь выход, когда я бегу RSpec
Failures:
1) ArticlesController index action should render index template
Failure/Error: Unable to find matching line from backtrace
SQLite3::ConstraintException: articles.user_id may not be NULL