Created
September 20, 2012 03:54
-
-
Save yurikoval/3753886 to your computer and use it in GitHub Desktop.
Speed up rspec controllers test using mock before all
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
# http://stackoverflow.com/a/9460051/148270 | |
describe SomeController do | |
render_views | |
describe "GET 'index'" do | |
before(:each) do | |
@@response ||= begin | |
get 'index' | |
response | |
end | |
end | |
subject { @@response } | |
it { should be_success } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment