Skip to content

Instantly share code, notes, and snippets.

@robertsosinski
Created February 21, 2012 20:48
Show Gist options
  • Save robertsosinski/1878824 to your computer and use it in GitHub Desktop.
Save robertsosinski/1878824 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Api::V9::Authenticatable, :type => :controller do
before do
class EndpointsController < ActionController::Base
include Api::V9::Authenticatable
def index
render :text => 'foo'
end
end
@controller = EndpointsController.new
Rails.application.routes.draw do
match '/endpoint' =>'endpoints#index'
end
end
after do
# be sure to reload routes after the tests run, otherwise all your other controller specs will fail
Rails.application.reload_routes!
end
it 'should a valid request' do
get :index
end
end
@khalilovcmd
Copy link

This is great! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment