Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-15 18:36:35 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-15 18:36:35 +0400
commit752eb2c11d9125d9b7b60bc7719db954ebb1d9a5 (patch)
tree20761fd2924fedc66363c06a6fbc484bc6821499 /spec
parentb059de2ac7ad6f47a39ca124764c8e3e661e76f9 (diff)
more tests fixed
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/votes_spec.rb6
-rw-r--r--spec/mailers/notify_spec.rb5
-rw-r--r--spec/observers/note_observer_spec.rb3
3 files changed, 5 insertions, 9 deletions
diff --git a/spec/lib/votes_spec.rb b/spec/lib/votes_spec.rb
index 7e49ac781c2..b49ed15b5c3 100644
--- a/spec/lib/votes_spec.rb
+++ b/spec/lib/votes_spec.rb
@@ -1,14 +1,8 @@
require 'spec_helper'
-describe Issue do
- it { should include_module(Votes) }
-end
-
describe MergeRequest do
let(:merge_request) { FactoryGirl.create(:merge_request_with_diffs) }
- it { should include_module(Votes) }
-
describe "#upvotes" do
it "with no notes has a 0/0 score" do
merge_request.upvotes.should == 0
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index e5b4cdaf330..01e3c3f14c4 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -191,7 +191,7 @@ describe Notify do
let(:note) { create(:note, project: project, author: note_author) }
before :each do
- Note.stub(:find).with(note.id).and_return(note)
+ Note.stub(:find).with(note.id).and_return(note)
end
shared_examples 'a note email' do
@@ -233,9 +233,10 @@ describe Notify do
commit.stub(:safe_message).and_return('some message')
end
end
+
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'
diff --git a/spec/observers/note_observer_spec.rb b/spec/observers/note_observer_spec.rb
index 73da2e146cb..8ad42c21d2c 100644
--- a/spec/observers/note_observer_spec.rb
+++ b/spec/observers/note_observer_spec.rb
@@ -41,8 +41,9 @@ describe NoteObserver do
it 'notifies the author of a commit when flagged to notify the author' do
note.stub(:notify_author).and_return(true)
+ note.stub(:noteable).and_return(double(author_email: 'test@test.com'))
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)
Notify.should_receive(:note_commit_email)