Commit 752eb2c1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

more tests fixed

parent b059de2a
require 'spec_helper' require 'spec_helper'
describe Issue do
it { should include_module(Votes) }
end
describe MergeRequest do describe MergeRequest do
let(:merge_request) { FactoryGirl.create(:merge_request_with_diffs) } let(:merge_request) { FactoryGirl.create(:merge_request_with_diffs) }
it { should include_module(Votes) }
describe "#upvotes" do describe "#upvotes" do
it "with no notes has a 0/0 score" do it "with no notes has a 0/0 score" do
merge_request.upvotes.should == 0 merge_request.upvotes.should == 0
......
...@@ -191,7 +191,7 @@ describe Notify do ...@@ -191,7 +191,7 @@ describe Notify do
let(:note) { create(:note, project: project, author: note_author) } let(:note) { create(:note, project: project, author: note_author) }
before :each do before :each do
Note.stub(:find).with(note.id).and_return(note) Note.stub(:find).with(note.id).and_return(note)
end end
shared_examples 'a note email' do shared_examples 'a note email' do
...@@ -233,9 +233,10 @@ describe Notify do ...@@ -233,9 +233,10 @@ describe Notify do
commit.stub(:safe_message).and_return('some message') commit.stub(:safe_message).and_return('some message')
end end
end end
before(:each) { note.stub(:noteable).and_return(commit) } before(:each) { note.stub(:noteable).and_return(commit) }
subject { Notify.note_commit_email(recipient.id, note.id) } subject { Notify.note_commit_email(recipient.email, note.id) }
it_behaves_like 'a note email' it_behaves_like 'a note email'
......
...@@ -41,8 +41,9 @@ describe NoteObserver do ...@@ -41,8 +41,9 @@ describe NoteObserver do
it 'notifies the author of a commit when flagged to notify the author' do it 'notifies the author of a commit when flagged to notify the author' do
note.stub(:notify_author).and_return(true) note.stub(:notify_author).and_return(true)
note.stub(:noteable).and_return(double(author_email: 'test@test.com'))
note.stub(:id).and_return(42) note.stub(:id).and_return(42)
author = double :user, id: 1 author = double :user, id: 1, email: 'test@test.com'
note.stub(:commit_author).and_return(author) note.stub(:commit_author).and_return(author)
Notify.should_receive(:note_commit_email) Notify.should_receive(:note_commit_email)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment