Cucumber::Rails::World

引用
runs each scenario in an isolated DB transaction.

Cucumber::Rails::World
Cucumber::Rails::World is the bridge between Cucumber and
Rails. It provides the Rails integration testing methods within
each scenario.
When Cucumber’s Rails support is loaded by requiring cucum-
ber/rails/world in features/support/env.rb, instances of Cucum-
ber::Rails::World are configured to be the World for each sce-
nario:
World do
   Cucumber::Rails::World.new
end
                                inherits      Rails’
Cucumber::Rails::World                                   ActionCon-
troller::IntegrationTest, and makes surprisingly few modifications to
the superclass behaviour. Each scenario is run in a newly instan-
tiated Cucumber::Rails::World. This gives us access to all of the
functionality of Rails’ Integration tests and RSpec’s Rails-specific
matchers, including simulating requests to the application and
specifying behaviour with RSpec expectations.
In the default configuration, it runs each scenario in an isolated
DB transaction. You can disable this by removing the following
line from the features/support/env.rb generated by Cucumber:
Cucumber::Rails.use_transactional_fixtures
If you disable per-scenario transactions, you’ll have to worry
about records left over from one scenario affecting the results
of the next. This often leads to inadvertent and subtle order-
ing dependencies in your scenario build. For these reasons, we
strongly recommend using the transactional fixtures setting.∗

你可能感兴趣的:(Access,Rails,rspec)