title: Seeds.rb development environment also getting applied to test environment
body: <p>I need certain things to be seeded into a test environment, specifically, user roles from CanCan. BUT it seems to load everything under development.</p>
  
  <p><em>lib/tasks/test</em> _ <em>seed.rake</em></p>
  
  <pre><code>namespace :db do
    namespace :test do
      task :prepare =&gt; :environment do
        Rake::Task["db:seed"].invoke
      end
    end
  end
  </code></pre>
  
  <p>which correctly pulls in seeds.rb after running bundle exec rake db:test:prepare</p>
  
  <p><em>db/seeds.rb</em></p>
  
  <pre><code>admin = Role.create( { name: "admin" }, :without_protection =&gt; true)
  user  = Role.create( { name: "user"  }, :without_protection =&gt; true)
  
  if Rails.env.production? || Rails.env.development?
  
    admin = User.create!({ name:     "Admin",
                           email:    "admin@example.com",
                           password: "foobar",
                           password_confirmation: "foobar",
                           role_ids:  1 },
                           :without_protection =&gt; true)
    admin.confirm!    
  
    if Rails.env.development?
  
      48.times do |n|
        name  = Faker::Name.name
        email = "example-#{n+1}@example.com"
        password  = "foobar"
        fake = User.create!({ name:     name,
                              email:    email,
                              password: password,
                              password_confirmation: password },
                              :without_protection =&gt; true)
        fake.confirm!
      end
    end
  end
  </code></pre>
  
  <p>All looks good but then........</p>
  
  <pre><code>$ rails console test
  Loading test environment (Rails 3.2.8)
    &gt; User.first
  User Load (1.0ms) SELECT "users".* FROM "users" LIMIT 1
    =&gt; #&lt;User id: 1, email: "admin@example.com" ..................
    &gt; Rails.env.development?
    =&gt; false
  </code></pre>
  
  <p>What wrong?</p>