Skip to content

Instantly share code, notes, and snippets.

@linjunpop
Last active August 14, 2021 05:42
Show Gist options
  • Save linjunpop/4367228 to your computer and use it in GitHub Desktop.
Save linjunpop/4367228 to your computer and use it in GitHub Desktop.

Revisions

  1. linjunpop revised this gist Feb 19, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions request_helper.rb
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    # spec/request_helper.rb

    ENV["RAILS_ENV"] ||= 'capybara'
    ENV["RAILS_ENV"] = 'capybara'

    RSpec.configure do |config|
    config.before(:all) do
    config.before(:suite) do
    %x[bundle exec rake assets:precompile]
    end
    end
  2. linjunpop renamed this gist Jan 7, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. linjunpop revised this gist Dec 24, 2012. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions capybara.rb
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,11 @@
    config.serve_static_assets = true
    config.static_cache_control = "public, max-age=3600"

    config.assets.digest = false
    config.assets.prefix = "/capybara_test_assets"
    config.assets.compress = true
    config.assets.compile = false

    config.assets.precompile += %w(email.css)

    config.assets.digest = true
    config.assets.prefix = "/capybara_test_assets"
    end
  4. linjunpop created this gist Dec 24, 2012.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Capybara, Rspec, Rails assets pipeline

    A clean workaround for running capybara tests on Rails with assets pipeline enabled.

    Original: https://github.com/jnicklas/capybara/pull/500#issuecomment-2972597
    11 changes: 11 additions & 0 deletions capybara.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # environments/capybara.rb

    Dummy::Application.configure do
    config.serve_static_assets = true
    config.static_cache_control = "public, max-age=3600"

    config.assets.digest = false
    config.assets.prefix = "/capybara_test_assets"

    config.assets.precompile += %w(email.css)
    end
    9 changes: 9 additions & 0 deletions request_helper.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # spec/request_helper.rb

    ENV["RAILS_ENV"] ||= 'capybara'

    RSpec.configure do |config|
    config.before(:all) do
    %x[bundle exec rake assets:precompile]
    end
    end