Simply, `Scope` is being redefined:
```irb
>> class Scope < Struct.new(:user, :scope); end
 => nil 
>> class Scope < Struct.new(:user, :scope); end
TypeError: superclass mismatch for class Scope
```

The error is a symptom of a larger problem: you should move this code into a static file in the test environment. You can do that like this:
+ make the folder `spec/support/templates/policies`
+ move the code into its respective files in that folder
+ add this line to [`spec/support/rails_template.rb`](https://github.com/gregbell/active_admin/blob/19681c4f8019221d1c63513b06be0376606c26bb/spec/support/rails_template.rb#L71-L72):

```ruby
directory File.expand_path('../templates/policies', __FILE__), 'app/policies'
```

Then recreate your test environment by running `rm -rf spec/rails` and rerunning the tests :octocat: