venkat
venkat

Reputation: 2310

Testing your ActiveAdmin resources with RSpec

I am new to Rails. I want to test my activeadmin resources as mentioned in the following link

https://github.com/activeadmin/activeadmin/wiki/Testing-your-ActiveAdmin-controllers-with-RSpec

My simple test as follows

require 'spec_helper'

describe "activeadmin resources" do

  it "should have admin user resource" do

    ActiveAdmin.application.namespaces[:admin].resources.should have_key("AdminUser")

  end

end

But I am getting the error

NameError: uninitialized constant ActiveAdmin`

I tried to require activeadmin gem in spec_helper, but no use. Any idea?

Upvotes: 1

Views: 1346

Answers (1)

venkat
venkat

Reputation: 2310

Just by changing

require 'spec_helper'

to

require 'rails_helper'

the error was resolved.

Upvotes: 1

Related Questions