提交 a2a00600 编写于 作者: R Riyad Preukschas

Rename Upvote role to Votes

上级 06c1a8a9
class Issue < ActiveRecord::Base
include IssueCommonality
include Upvote
include Votes
acts_as_taggable_on :labels
......
......@@ -2,7 +2,7 @@ require File.join(Rails.root, "app/models/commit")
class MergeRequest < ActiveRecord::Base
include IssueCommonality
include Upvote
include Votes
BROKEN_DIFF = "--broken-diff"
......
module Upvote
module Votes
# Return the number of +1 comments (upvotes)
def upvotes
notes.select(&:upvote?).size
......
......@@ -12,7 +12,7 @@ describe Issue do
describe 'modules' do
it { should include_module(IssueCommonality) }
it { should include_module(Upvote) }
it { should include_module(Votes) }
end
subject { Factory.create(:issue) }
......
......@@ -8,6 +8,6 @@ describe MergeRequest do
describe 'modules' do
it { should include_module(IssueCommonality) }
it { should include_module(Upvote) }
it { should include_module(Votes) }
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册