Skip to content
Extraits de code Groupes Projets
Valider a92a374b rédigé par zhitomirskiyi's avatar zhitomirskiyi
Parcourir les fichiers

added the files and fixed the tests

parent 249b6244
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -87,7 +87,7 @@ describe Notifier do
let!(:comment) { user2.comment("Totally is", :on => sm )}
describe "#comment_on_post" do
let!(:comment_mail) {Notifier.comment_on_post(user.id, person.id, comment).deliver}
let!(:comment_mail) {Notifier.comment_on_post(user.id, person.id, comment.id).deliver}
it 'goes to the right person' do
comment_mail.to.should == [user.email]
......@@ -108,7 +108,7 @@ describe Notifier do
end
describe "#also commented" do
let!(:comment_mail) {Notifier.also_commented(user.id, person.id, comment)}
let!(:comment_mail) {Notifier.also_commented(user.id, person.id, comment.id)}
it 'goes to the right person' do
comment_mail.to.should == [user.email]
......
......@@ -68,34 +68,18 @@ describe Notification do
Notification.notify(@user, request, @person)
end
context 'emails the user' do
it 'email with notifications enabled' do
request = Request.instantiate(:from => @user.person, :to => @user2.person, :into => @aspect)
opts = {:target_id => request.id,
:kind => request.notification_type(@user, @person),
describe '#emails_the_user' do
it 'calls mail' do
opts = {
:kind => "new_request",
:person_id => @person.id,
:user_id => @user.id}
n = Notification.create(opts)
Notification.stub!(:create).and_return n
n = Notification.new(opts)
n.stub!(:user).and_return @user
n.should_receive(:email_the_user).once
Notification.notify(@user, request, @person)
end
it 'does not email with emails disabled' do
request = Request.instantiate(:from => @user.person, :to => @user2.person, :into => @aspect)
opts = {:target_id => request.id,
:kind => request.notification_type(@user, @person),
:person_id => @person.id,
:user_id => @user.id}
n = Notification.create(opts)
Notification.stub!(:create).and_return n
@user.disable_mail = true
n.should_not_receive(:email_the_user)
Notification.notify(@user, request, @person)
@user.should_receive(:mail)
n.email_the_user("mock")
end
end
end
......
......@@ -60,14 +60,6 @@ describe Diaspora::UserModules::Connecting do
Resque.should_receive(:enqueue).with(Jobs::MailRequestReceived, user.id, person.id)
user.receive_object(@r, person)
end
it 'should not lock the connection after ignore' do
user.send_friend_request_to(user2, aspect)
user2.pending_request.count.should == 1
user2.ignore_request(user2.pending_requests.first)
user.send_friend_request_to(user2, aspect)
user2.pending_request.count.should == 1
end
end
describe '#receive_request_acceptance' do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter