more tests fixed

This commit is contained in:
Dmitriy Zaporozhets 2013-01-15 16:36:35 +02:00
parent b059de2ac7
commit 752eb2c11d
3 changed files with 5 additions and 9 deletions

View file

@ -1,14 +1,8 @@
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

View file

@ -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'

View file

@ -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)