Forum: Ruby on Rails UserEngine and the test environment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
François B. (Guest)
on 2006-03-16 05:33
(Received via mailing list)
Hi !

I was going to write a test that asserts that my home page
controller's index action is available for guests:

class RootControllerTest < Test::Unit::TestCase
  def test_guest_access_granted_to_home_page
    get :index
    assert_response :success
  end
end

Obviously, this test fails.  If I change the dev DB, I can test in the
browser, and it works fine.  But, the test DB does not contain the
necessary permissions and roles.

I added this to test/test_helper.rb:

unless Object.const_defined?('PermissionSynchronized')
  $stderr.puts "Synchronizing permissions"
  Permission.sychronize_controllers
  PermissionSynchronized = true
end

which ensures my permissions are created for the test environment.
The only thing missing is now roles.  How should I map them ?  Should
I write a SQL copy of the dev DB to the test DB ?

This is my first exposure to UserEngine.

Thanks for any help !
This topic is locked and can not be replied to.