Permalink
Browse files

Merge pull request #1 from ryanb/master

Run under production
  • Loading branch information...
2 parents 23c77fc + 93b3371 commit fd8746fe964d67762ec170cada0e7a72dbd09d6c @steveklabnik committed Sep 28, 2012
Showing with 8 additions and 5 deletions.
  1. +2 −0 .gitignore
  2. +2 −1 README.md
  3. +2 −2 config/environments/production.rb
  4. +1 −1 spec/requests/turbolinks_spec.rb
  5. +1 −1 spec/spec_helper.rb
View
2 .gitignore
@@ -13,3 +13,5 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
+
+/public/assets
View
3 README.md
@@ -40,7 +40,8 @@ Twitter any day.
```
$ bundle
-$ rspec
+$ rake assets:precompile
+$ TIMES=100 rspec
```
Done.
View
4 config/environments/production.rb
@@ -8,8 +8,8 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
- # Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
+ # Serve the assets through Rails since we aren't running behind Apache/Nginx
+ config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
View
2 spec/requests/turbolinks_spec.rb
@@ -4,7 +4,7 @@
describe "Turbolinks" do
it "tests performance", :js => true do
- n = 1000
+ n = ENV["TIMES"] ? ENV["TIMES"].to_i : 1000
Benchmark.bm do |x|
x.report " no turbolinks" do
visit "/pages/1"
View
2 spec/spec_helper.rb
@@ -1,5 +1,5 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
+ENV["RAILS_ENV"] ||= 'production' # run in production since we're benchmarking
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

0 comments on commit fd8746f

Please sign in to comment.