Created
October 1, 2012 15:34
-
-
Save deviantbits/3812538 to your computer and use it in GitHub Desktop.
Test a module included in a controller with RSpec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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