Created
October 30, 2015 13:54
-
-
Save daxadax/c0e8b6bea0a17c76ef97 to your computer and use it in GitHub Desktop.
Revisions
-
daxadax created this gist
Oct 30, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ describe 'database performance' do before { @sql_calls = 0 } after { ActiveSupport::Notifications.unsubscribe(@subscription) } it 'makes a minimum of db queries' do @subscription = ActiveSupport::Notifications.subscribe('sql.active_record') do |event| @sql_calls += 1 end get :index, attributes.merge(format: :json) expect(@sql_calls).to be < 25 end end