diff --git a/lib/avocado/example.rb b/lib/avocado/example.rb
index <HASH>..<HASH> 100644
--- a/lib/avocado/example.rb
+++ b/lib/avocado/example.rb
@@ -16,8 +16,9 @@ module Avocado
     protected
 
       def resource_name_from_url(path, method)
-        Rails.application.routes.recognize_path(path, method: method)[:controller].
-          partition('/').last.titleize.split('/').last
+        controller = Rails.application.routes.recognize_path(path, method: method)[:controller]
+        name = controller.partition('/').reject(&:blank?).last
+        name.titleize.split('/').last
       rescue ActionController::RoutingError
         nil
       end
diff --git a/lib/avocado/rspec.rb b/lib/avocado/rspec.rb
index <HASH>..<HASH> 100644
--- a/lib/avocado/rspec.rb
+++ b/lib/avocado/rspec.rb
@@ -2,8 +2,15 @@ require 'avocado'
 require 'avocado/rspec/spec'
 require 'rack/test'
 
+module AvocadoHelper
+  def app
+    Rails.application
+  end
+end
+
 RSpec.configure do |config|
 
+  config.include AvocadoHelper
   config.include Rack::Test::Methods
 
   config.after(:each) do
RSpec will be able to parse the name even if the controller name doesn't have a slash (for non-namespaced APIs)