README.textile in combustion-0.3.3 vs README.textile in combustion-0.4.0
- old
+ new
@@ -9,18 +9,18 @@
Get the gem into either your gemspec or your Gemfile, depending on how you manage your engine's dependencies:
<pre><code># gemspec
gem.add_development_dependency 'combustion', '~> 0.3.1'
# Gemfile
-gem 'combustion', '~> 0.3.1', :group => :development</code></pre>
+gem 'combustion', '~> 0.3.1', :group => :test</code></pre>
In your @spec_helper.rb@, get Combustion to set itself up - which has to happen before you introduce @rspec/rails@ and - if being used - @capybara/rails@. Here's an example within context:
<pre><code>require 'rubygems'
require 'bundler'
-Bundler.require :default, :development
+Bundler.require :default, :test
require 'capybara/rspec'
Combustion.initialize!
@@ -48,15 +48,29 @@
<pre><code>Combustion.path = 'spec/dummy'
Combustion.initialize!</code></pre>
h3. Configuring which Rails modules should be loaded.
-By default, Combustion assumes you want the full Rails stack. You can customise this though - just pass in what you'd like loaded to the @Combustion.initialize!@ call:
+By default, Combustion doesn't come with any of the Rails stack. You can customise this though - just pass in what you'd like loaded to the @Combustion.initialize!@ call:
-<pre><code>Combustion.initialize! :active_record, :action_controller,
- :action_view, :sprockets</code></pre>
+<pre><code>
+Combustion.initialize! :active_record, :action_controller,
+ :action_view, :sprockets
+</code></pre>
+And then in your engine's Gemfile:
+
+<pre><code>
+group :test do
+ gem 'activerecord'
+ gem 'actionpack' # action_controller, action_view
+ gem 'sprockets'
+end
+</code></pre>
+
+Make sure to specify the appropriate version that you want to use.
+
ActiveSupport is always loaded, as it's an integral part of Rails.
h3. Using Models and ActiveRecord
If you're using ActiveRecord, then there are two critical files within your internal Rails app at @spec/internal@ that you'll need to modify:
@@ -92,9 +106,13 @@
<pre><code>Rails.application.routes.draw do
resources :pages
end</code></pre>
Just like in a standard Rails app, if you have a mounted engine, then its routes are accessible through whatever it has been loaded as.
+
+h3. Using other Rails-focused libraries
+
+Be aware that other gems may require parts of Rails when they're loaded, and this could cause some issues with Combustion's own setup. You may need to manage the loading yourself by setting @:require@ to false in your Gemfile for the gem in question, and then requiring it manually in your spec_helper. View "this issue":https://github.com/pat/combustion/issues/33 for an example with FactoryGirl.
h3. Environment and Logging
Your tests will execute within the test environment for the internal Rails app - and so logs are available at @spec/internal/log/test.log@. You should probably create that log directory so Rails doesn't complain.