Commit 752eb2c11d9125d9b7b60bc7719db954ebb1d9a5
1 parent
b059de2a
Exists in
master
and in
4 other branches
more tests fixed
Showing
3 changed files
with
5 additions
and
9 deletions
Show diff stats
spec/lib/votes_spec.rb
| 1 | 1 | require 'spec_helper' |
| 2 | 2 | |
| 3 | -describe Issue do | |
| 4 | - it { should include_module(Votes) } | |
| 5 | -end | |
| 6 | - | |
| 7 | 3 | describe MergeRequest do |
| 8 | 4 | let(:merge_request) { FactoryGirl.create(:merge_request_with_diffs) } |
| 9 | 5 | |
| 10 | - it { should include_module(Votes) } | |
| 11 | - | |
| 12 | 6 | describe "#upvotes" do |
| 13 | 7 | it "with no notes has a 0/0 score" do |
| 14 | 8 | merge_request.upvotes.should == 0 | ... | ... |
spec/mailers/notify_spec.rb
| ... | ... | @@ -191,7 +191,7 @@ describe Notify do |
| 191 | 191 | let(:note) { create(:note, project: project, author: note_author) } |
| 192 | 192 | |
| 193 | 193 | before :each do |
| 194 | - Note.stub(:find).with(note.id).and_return(note) | |
| 194 | + Note.stub(:find).with(note.id).and_return(note) | |
| 195 | 195 | end |
| 196 | 196 | |
| 197 | 197 | shared_examples 'a note email' do |
| ... | ... | @@ -233,9 +233,10 @@ describe Notify do |
| 233 | 233 | commit.stub(:safe_message).and_return('some message') |
| 234 | 234 | end |
| 235 | 235 | end |
| 236 | + | |
| 236 | 237 | before(:each) { note.stub(:noteable).and_return(commit) } |
| 237 | 238 | |
| 238 | - subject { Notify.note_commit_email(recipient.id, note.id) } | |
| 239 | + subject { Notify.note_commit_email(recipient.email, note.id) } | |
| 239 | 240 | |
| 240 | 241 | it_behaves_like 'a note email' |
| 241 | 242 | ... | ... |
spec/observers/note_observer_spec.rb
| ... | ... | @@ -41,8 +41,9 @@ describe NoteObserver do |
| 41 | 41 | |
| 42 | 42 | it 'notifies the author of a commit when flagged to notify the author' do |
| 43 | 43 | note.stub(:notify_author).and_return(true) |
| 44 | + note.stub(:noteable).and_return(double(author_email: 'test@test.com')) | |
| 44 | 45 | note.stub(:id).and_return(42) |
| 45 | - author = double :user, id: 1 | |
| 46 | + author = double :user, id: 1, email: 'test@test.com' | |
| 46 | 47 | note.stub(:commit_author).and_return(author) |
| 47 | 48 | Notify.should_receive(:note_commit_email) |
| 48 | 49 | ... | ... |