diff --git a/db/seeds.rb b/db/seeds.rb index cef67b0f6..8e65d2925 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,5 +1,5 @@ # Default admin user (change password after first deploy to a server!) -if Administrator.count == 0 +if Administrator.count == 0 && !Rails.env.test? admin = User.create!(username: 'admin', email: 'admin@madrid.es', password: '12345678', password_confirmation: '12345678', confirmed_at: Time.now, terms_of_service: "1") admin.create_administrator end diff --git a/spec/features/stats_spec.rb b/spec/features/stats_spec.rb index ef8d15ad5..b0360aeb1 100644 --- a/spec/features/stats_spec.rb +++ b/spec/features/stats_spec.rb @@ -42,16 +42,10 @@ feature 'Stats' do end scenario 'Users' do - Administrator.destroy_all - User.all.map(&:really_destroy!) - 1.times { create(:user, :level_three) } 2.times { create(:user, :level_two) } 3.times { create(:user) } - admin = create(:administrator) - login_as(admin.user) - visit admin_stats_path expect(page).to have_content "Level three users 1"