Skip to content

Instantly share code, notes, and snippets.

@mstroming
Created April 29, 2013 19:52
Show Gist options
  • Save mstroming/8ff0ea09d556a7f99e72 to your computer and use it in GitHub Desktop.
Save mstroming/8ff0ea09d556a7f99e72 to your computer and use it in GitHub Desktop.
Ruby unit test to test the slow loading of a datastream (replace Model and test_pid with your model and pid)
require 'spec_helper'
describe "load an object" do
it "should load within 5 seconds" do
start_time = Time.now
@object = Model.find("test_pid")
end_time = Time.now
(end_time - start_time).should <= 5
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment