From e5d37c7949974b32bcc359a35a59770ac5a90d04 Mon Sep 17 00:00:00 2001 From: Pistos Date: Wed, 9 Nov 2011 21:35:08 -0500 Subject: [PATCH 1/2] Whitespace cleanup. --- spec/models/status_message_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 5a0319bf3..9faa19837 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -20,7 +20,7 @@ describe StatusMessage do describe 'scopes' do describe '.where_person_is_mentioned' do it 'returns status messages where the given person is mentioned' do - @bo = bob.person + @bo = bob.person @test_string = "@{Daniel; #{@bo.diaspora_handle}} can mention people like Raph" Factory.create(:status_message, :text => @test_string ) @@ -316,7 +316,7 @@ STR @status_message.after_dispatch(alice) end end - + describe '#contains_url_in_text?' do it 'returns an array of all urls found in the raw message' do sm = Factory(:status_message, :text => 'http://youtube.com is so cool. so is https://joindiaspora.com') @@ -328,7 +328,7 @@ STR describe 'oembed' do it 'should queue a GatherOembedData if it includes a link' do sm = Factory.build(:status_message, :text => 'http://youtube.com is so cool. so is https://joindiaspora.com') - Resque.should_receive(:enqueue).with(Jobs::GatherOEmbedData, instance_of(Fixnum), instance_of(String)) + Resque.should_receive(:enqueue).with(Jobs::GatherOEmbedData, instance_of(Fixnum), instance_of(String)) sm.save end end From 31b43f315e20b968d1c2aa473deadbacba69900c Mon Sep 17 00:00:00 2001 From: Pistos Date: Wed, 9 Nov 2011 21:35:16 -0500 Subject: [PATCH 2/2] Corrected the message length spec. --- spec/models/status_message_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 9faa19837..5cbb587d6 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -116,12 +116,10 @@ describe StatusMessage do db_status.text.should == message end - it 'should require status messages to be less than 65535 characters' do - message = '' - 65535.times{message = message +'1'} - status = Factory.build(:status_message, :text => message) - - status.should_not be_valid + it 'should require status messages not be more than 65535 characters long' do + message = 'a' * (65535+1) + status_message = Factory.build(:status_message, :text => message) + status_message.should_not be_valid end describe 'mentions' do