I've created a plugin for Redmine, and now am having difficulties writing the test cases for it. I am not using any framework like rspec for this, just the default asserts provided by rails.
I first ran my test by running the file trough the ruby interpreter. This did not load the fixtures , so I found an alternative : I copied the fixtures file to ${redmine_root}/test/fixtures, from ${redmine_root}/vendor/plugins/my_plugin/test/fixtures, ran rake db:fixtures:load and now it loads them.
The controller that I'm testing has permissions set in init.rb, and requires authorization for some actions.
Although I open a session as a privileged user (Admin), I am not authorized to take the actions in the controller, somehow it does not load the permissions at the beginning of the test.
I have added the permissions manually in roles.yml, and ensured that the user has the appropriate role, but again nothing. The plugin works well, I am experiencing these problems only when testing. If I comment the line with before_filter :authorize in my controller, the test passes.
Am I missing something? Are the permissions from init.rb stored in a different place, or are loaded differently during the test phase?