diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 3b9e090f9bb23c01f223fb6e35fbfdb8204078f4..3504cfc7306ee6160e3c3e66764ce08a2b52da71 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper' describe Diaspora::Parser do before do - @user = Factory.create(:user, :email => "bob@aol.com") + @user = Factory.create(:user) @aspect = @user.aspect(:name => 'spies') @user3 = Factory.create :user @@ -20,7 +20,7 @@ describe Diaspora::Parser do end it 'should be able to correctly handle comments with person in db' do - person = Factory.create(:person, :diaspora_handle => "test@testing.com") + person = Factory.create(:person) post = Factory.create(:status_message, :person => @user.person) comment = Factory.build(:comment, :post => post, :person => person, :text => "Freedom!") xml = comment.to_diaspora_xml diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 1db3f3f8296862921d3d9327f76bc4179a42882c..12f7837c14c7db6a06450299a7fe39b5aecf7fc6 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -5,34 +5,13 @@ require 'spec_helper' describe 'making sure the spec runner works' do - - it 'should not delete the database mid-spec' do - User.count.should == 0 - Factory.create(:user) - User.count.should == 1 - end - - it 'should make sure the last user no longer exsists' do - User.count.should == 0 - end - it 'should factory create a user with a person saved' do user = Factory.create(:user) loaded_user = User.first(:id => user.id) loaded_user.person.owner_id.should == user.id end - describe 'testing a before do block' do - before do - Factory.create(:user) - end - - it 'should have cleaned before the before do block runs' do - User.count.should == 1 - end - - end - describe '#friend_users' do + describe '#friend_users' do before do @user1 = Factory.create(:user) @aspect1 = @user1.aspect(:name => "losers") diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index b2f2d3c6158802956ec22790fcccbf70e630d59c..08252ada2789f24e413d66d9940440914f4d3696 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -18,7 +18,7 @@ describe Comment do status.comments.should == [] @user.comment "Yeah, it was great", :on => status - StatusMessage.first.comments.first.text.should == "Yeah, it was great" + status.reload.comments.first.text.should == "Yeah, it was great" end it "should be able to comment on a person's status" do @@ -26,8 +26,8 @@ describe Comment do status = Factory.create(:status_message, :person => person) @user.comment "sup dog", :on => status - StatusMessage.first.comments.first.text.should == "sup dog" - StatusMessage.first.comments.first.person.should == @user.person + status.reload.comments.first.text.should == "sup dog" + status.reload.comments.first.person.should == @user.person end it 'should not send out comments when we have no people' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 552fd884da34e1119246a4cb5b354f01ea121a77..9bc58c2e65ab046851ba0311d966178066546b15 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,19 +27,14 @@ RSpec.configure do |config| config.before(:suite) do DatabaseCleaner.clean_with(:truncation) + DatabaseCleaner.clean stub_signature_verification - end config.before(:each) do - DatabaseCleaner.start stub_sockets User.stub!(:allowed_email?).and_return(:true) end - - config.after(:each) do - DatabaseCleaner.clean - end end ImageUploader.enable_processing = false