diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 401d50a17dda9ebaaf72a9ce0030106f1a4ef060..d35a395a52edf1f1f691562354c1c2bcd1963684 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -3,10 +3,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe UsersController do render_views #fixtures here? - it 'should, after logging in redirect to the dashboard page' do - post 'index' - puts "boner!" - end + end end diff --git a/spec/models/misc_spec.rb b/spec/models/misc_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..abbf71e45fdff98a3ec61d69531cd1200b60668e --- /dev/null +++ b/spec/models/misc_spec.rb @@ -0,0 +1,27 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe 'making sure the spec runner works' do + + it 'should not delete the database mid-spec' do + User.count.should == 0 + billy = User.create(:email => "billy@aol.com", :password => "foobar") + User.count.should == 1 + end + + it 'should make sure the last user no longer exsists' do + User.count.should == 0 + end + + describe 'testing a before do block' do + before do + @bill = User.create(:email => "billy@aol.com", :password => "foobar") + + end + + it 'should have cleaned before the before do block runs' do + User.count.should == 1 + end + + end + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b652dadd1854ab7a68b27154483b87fe7a648e2f..341d789491a6615d8ab5c79889b10e96db8a8f1f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,6 +19,9 @@ Rspec.configure do |config| config.mock_with :rspec config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.before(:each) do + Mongoid.master.collections.select { |c| c.name != 'system.indexes' }.each(&:drop) + end # If you're not using ActiveRecord, or you'd prefer not to run each of your