diff --git a/app/models/reshare.rb b/app/models/reshare.rb index cfb17a646..15a1dc7db 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -36,7 +36,7 @@ class Reshare < Post def notification_type(user, person) Notifications::Reshared if root.author == user.person end - + private def after_parse @@ -71,7 +71,7 @@ class Reshare < Post def root_must_be_public if self.root && !self.root.public - errors[:base] << "you must reshare public posts" + errors[:base] << "Only posts which are public may be reshared." return false end end diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index 51687a2a1..5795fc9eb 100644 --- a/spec/models/reshare_spec.rb +++ b/spec/models/reshare_spec.rb @@ -18,7 +18,9 @@ describe Reshare do end it 'require public root' do - Factory.build(:reshare, :root => Factory.build(:status_message, :public => false)).should_not be_valid + reshare = Factory.build(:reshare, :root => Factory.build(:status_message, :public => false)) + reshare.should_not be_valid + reshare.errors[:base].should include('Only posts which are public may be reshared.') end it 'forces public' do