Skip to content

Instantly share code, notes, and snippets.

@deviantbits
Created October 1, 2012 15:34
Show Gist options
  • Select an option

  • Save deviantbits/3812538 to your computer and use it in GitHub Desktop.

Select an option

Save deviantbits/3812538 to your computer and use it in GitHub Desktop.
Test a module included in a controller with RSpec
require 'spec_helper'
describe MyModule::Name, :type => :controller do
controller(ActionController::Base) do
include MyModule::Name
def index
render nothing: true
end
end
context "some context" do
it "tests something" do
get :index
# Add test logic
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment