Skip to content

Instantly share code, notes, and snippets.

@yurikoval
Created September 20, 2012 03:54
Show Gist options
  • Save yurikoval/3753886 to your computer and use it in GitHub Desktop.
Save yurikoval/3753886 to your computer and use it in GitHub Desktop.
Speed up rspec controllers test using mock before all
# 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