Have an app where i'm using Rolify and Pundit for authorization and Minitest/fixtures for testing.
When i setup a user as administrator using fixtures, i'm not getting back a true for an assertion.
/fixtures/users.yml
administrator:
email: admin@example.com
roles: admin
/fixtures/roles.yml
admin:
id: 1
name: admin
test.rb
it "is administrator" do
User.first.has_role?('admin').must_equal true
end
The test comes back as false, i've tried the admin with a symbol and still get the same thing.
When a user in that development environment has admin, i get true when i ask if the role is admin.
Test framework is minitest and my user model is rolified