I am using Rspec 2 and capybara and defined the basic integration test, i.e.

describe "EeRequisitions" do
  describe "GET /ee_requisitions" do
    it "works! (now write some real specs)" do
      get ee_requisitions_path
      response.status.should be(200)
    end
  end
end


Since the app uses HTTP basic authentication and since capybara says it includes Rack::Test, I expected that adding the line:

authorize 'user', 'password'


would handle it (I've since lost the stackoverflow post that told me that). Unfortunately it didn't - it kept throwing a 'method not found' error.  I finally found the solution in a comment to this post: Rails/Rspec Make tests to pass with http basic authentication where Matt Connelly pointed me to this gist: https://gist.github.com/mattconnolly/4158961 which finally solved my problem.

However, I'm still wondering why the Rack::Test approach failed as it seems to have worked for others.


Question: Configure which plugin custom post types get registered
Answer: 
  The issue i'm having is that custom post types register_post_type has
  to be called during init and functions.php is read far after this.


That's not true. functions.php is read before init because you can declare your functions in there and then hook them to init.

Since you want to avoid a settings page and you want your users to modify the code (at your own risk), you could use some flags:

add_action('init', 'wpse_109719_post_types');

function wpse_109719_post_types(){

  $post_type1 = true;
  $post_type2 = true;
  $post_type3 = false; // your users don't want this one

  if( $post_type1 ){
    register_post_type( 'your_post_type_1', $args );
  }

  if( $post_type2 ){
    register_post_type( 'your_post_type_2', $args );
  }

  if( $post_type3 ){
    // won't be registered since $post_type3 was declared as false
    register_post_type( 'your_post_type_3', $args );
  }

}



Not tested, but you can use something like that to collect the post types:

$val = array ();
$options_array = apply_filters( 'my_unique_filter', $val );
print_r( $options_array );
// make a loop and register_post_type here. don't forget to hook at init


In your plugins:

function filter1( $val ){
  $val[] = 'post_type1';
  return $val;
}

function filter2( $val ){
  $val[] = 'post_type2';
  return $val;
}

function filter3( $val ){
  $val[] = 'post_type3';
  return $val;
}


add_filter('my_unique_filter', 'filter1');
add_filter('my_unique_filter', 'filter2');
add_filter('my_unique_filter', 'filter3');