title: Rspec testing ActiveAdmin create action
body: <p>My rails application has model <code>Institution</code> that only an <code>AdminUser</code> can create. My <code>app/admin/institution.rb</code> file looks like this: </p>
  
  <pre><code>ActiveAdmin.register Institution do
  
    permit_params :name, :email
  
    index do
      id_column
      %W(name email).each do |field|
        column field.to_sym
      end
      actions
    end
  
    form do |f|
      f.inputs do
        f.input :name
        f.input :email
        f.actions
      end
  
    end
  
  end
  </code></pre>
  
  <p>and the corresponding route for creating an institution is <code>POST /admin/institutions</code>. </p>
  
  <p>Is there a simple way to test this route/action in rspec? There are very few resources online about testing ActiveAdmin. All I could find was <a href="https://github.com/activeadmin/activeadmin/wiki/Testing-your-ActiveAdmin-resources-with-RSpec" rel="nofollow noreferrer">this</a>, <a href="https://github.com/activeadmin/activeadmin/wiki/testing-your-activeadmin-controllers-with-rspec" rel="nofollow noreferrer">this</a> and <a href="https://stackoverflow.com/questions/18240851/write-controller-and-feature-specs-for-activeadmin-using-rspec">this</a>, the last of which seemed closest to what I am looking for, but not exactly. </p>
  
  <p>I just want a way to test the <code>POST /admin/institutions</code> endpoint, passing it only the two required params (name and email). However the following rspec test fails: </p>
  
  <pre><code>describe Admin::InstitutionsController, :type =&gt; :controller do
  
    before(:each) do
      @user = FactoryGirl.create(:admin_user)
      sign_in @user
    end
  
    it 'creates an institution' do
      post :create, name: "test_name", email: "test@email.com"
      expect(Institution.all.count).to eq(1)
    end
  
  end
  </code></pre>
  
  <p>No institution is being created but I do not get any errors. Any help is appreciated, thanks. </p>
  
  <p>-Greg</p>