I'm not able to access urls in my integration test that require an admin user despite creating an admin user session. My test fails on a 302 error.
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
I've got the following in the test.log:
Unable to load roles_user, underlying cause no such file to load -- roles_user
My fixtures file is named roles_users.yml as you would expect - so unsure of how to resolve this...