Skip to content

Instantly share code, notes, and snippets.

@thoughtless
Forked from m1foley/gist:2948b486cf23e16040c5
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoughtless/8dd6559636ea8da5d93d to your computer and use it in GitHub Desktop.
Save thoughtless/8dd6559636ea8da5d93d to your computer and use it in GitHub Desktop.
require "rails_helper"

describe "Speed Test" do
  10.times do
    it "uses fixtures" do
      users(:brad)
    end
  end

  10.times do
    it "uses FactoryGirl#create" do
      FactoryGirl.create(:presenter)
    end
  end

  10.times do
    it "uses FactoryGirl#build" do
      FactoryGirl.build(:presenter)
    end
  end
end
$ bundle exec rspec spec/models/speed_test_spec.rb:5
..........

Finished in 3.26 seconds
10 examples, 0 failures

$ bundle exec rspec spec/models/speed_test_spec.rb:11
..........

Finished in 10.72 seconds
10 examples, 0 failures

$ bundle exec rspec spec/models/speed_test_spec.rb:18
..........

Finished in 3.43 seconds
10 examples, 0 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment