管理者ユーザー セッションを作成しているにもかかわらず、統合テストで管理者ユーザーを必要とする URL にアクセスできません。私のテストは 302 エラーで失敗します。
class NewsItemsController < ApplicationController
before_filter :require_admin_user, :except => [:show, :index, :feed]
etc...
end
--test/inetgration/admin_stories.rb --
require 'test_helper'
class AdminStoriesTest < ActionController::IntegrationTest
fixtures :all
setup :activate_authlogic
# if user is an admin he can create a new news_item
def test_creating_a_news_item
assert UserSession.create(users(:admin))
get "news_items/new"
assert_response :success
#etc...
end
end
test.log に次の内容が記録されています。
Unable to load roles_user, underlying cause no such file to load -- roles_user
私のフィクスチャ ファイルは、ご想像のとおり、roles_users.yml という名前です。これを解決する方法がわかりません...