added two pending specs for mnutt

This commit is contained in:
zhitomirskiyi 2011-02-18 13:15:32 -08:00
parent a1fdd3cdf9
commit 6dc35c516a
2 changed files with 37 additions and 0 deletions

View file

@ -55,6 +55,25 @@ describe 'a user receives a post' do
@user1.aspects.size.should == num_aspects
end
context 'mentions' do
it 'adds the notifications for the mentioned users reguardless of the order they are received' do
pending 'this is for mnutt'
Notification.should_receive(:notify).with(@user1, anything(), @user2.person)
Notification.should_receive(:notify).with(@user3, anything(), @user2.person)
@sm = @user2.build_post(:status_message, :message => "@{#{@user1.name}; #{@user1.diaspora_handle}} stuff @{#{@user3.name}; #{@user3.diaspora_handle}}")
@sm.stub!(:socket_to_user)
@user2.add_to_streams(@sm, [@user2.aspects.first])
@sm.save
zord = Postzord::Receiver.new(@user1, :object => @sm, :person => @user2.person)
zord.receive_object
zord = Postzord::Receiver.new(@user3, :object => @sm, :person => @user2.person)
zord.receive_object
end
end
context 'update posts' do
it 'does not update posts not marked as mutable' do
status = @user1.post :status_message, :message => "store this!", :to => @aspect.id

View file

@ -8,6 +8,10 @@ describe Mention do
describe 'before create' do
before do
@user = alice
@aspect1 = @user.aspects.create(:name => 'second_aspect')
@mentioned_user = bob
@non_friend = eve
@sm = Factory(:status_message)
@m = Mention.new(:person => @user.person, :post=> @sm)
@ -22,6 +26,20 @@ describe Mention do
Notification.should_not_receive(:notify)
m.save
end
it 'should not notify a user if they do not see the message' do
pending "this is for mnutt"
connect_users(@user, @aspect1, @non_friend, @non_friend.aspects.first)
Notification.should_not_receive(:notify).with(@mentioned_user, anything(), @user.person)
sm2 = @user.build_post(:status_message, :message => 'stuff')
sm2.stub!(:socket_to_user)
@user.add_to_streams(sm2, [@aspect1])
m2 = Mention.new(:person => @mentioned_user.person, :post => @sm)
sm2.save
m2.save
end
end
describe '#notification_type' do