ruby on rails - rake cucumber and cucumber --tag @tagname give different results -
if use rake cucumber
fixtures not loaded , tests fail. if use cucumber --tag @tagname
run scenario loads fixtures, factories, , passes.
the bottom of /features/support/env.rb
looks this:
cucumber::rails::world.use_transactional_fixtures = true fixtures.reset_cache fixtures_folder = file.join(rails_root, 'spec', 'fixtures') fixtures = dir[file.join(fixtures_folder, '*.yml')].map {|f| file.basename(f, '.yml') } fixtures.create_fixtures(fixtures_folder, fixtures) if defined?(activerecord::base) begin require 'database_cleaner' databasecleaner.strategy = :truncation rescue loaderror => ignore_if_database_cleaner_not_present end end
everything else standard rails 3.
i had change line:
databasecleaner.strategy = :truncation, {:except => %w[degrees states_provinces contribution_types manuscript_types statuses countries roles user_templates]}
i needed of tables loaded tests pass databasecleaner truncating them after each scenario.
Comments
Post a Comment