relevant part of database.yml:
development:
adapter: mysql
encoding: utf8
database: dev
username: root
password:
test: &TEST
adapter: mysql
encoding: utf8
database: test
username: root
password:
cucumber:
<<: *TEST
culerity:
<<: *TEST
So, it seems that whenever cucumber interacts with the browser, it modifies the development database. But when I do things programmatically (such as adding a default user to login), it modifies the test database.
Why would the test env me responding to ruby/rails requests, but switches over to dev when the view-tests are running?
This is how I'm running cucumber:
$> bundle exec rake test:cucumber:authenticatio开发者_如何学运维n
which runs the task in this file:
begin
require 'rubygems'
ENV["RAILS_ENV"]="test"
require 'cucumber'
require 'cucumber/rake/task'
namespace :test do
namespace :cucumber do
Cucumber::Rake::Task.new(:authentication) do |t|
t.cucumber_opts = "features/Authentication.feature"
end
...
精彩评论