diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2019-10-17 08:15:07 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2019-10-23 05:48:00 +0300 |
commit | f8a130b16a59f5ba2b4513faa896fbace7a2ae45 (patch) | |
tree | eee6069ce7da356f30d92ddfa96448ca0c9a9d2a /spec | |
parent | ba8b47a7c0c19b404a89f7098ea648ff26d3d658 (diff) |
Add #to_ability_name to Project & Milestone
This will be used later for search filtering.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/milestone_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 2ecbe548520..120ba67f328 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -227,6 +227,14 @@ describe Milestone do end end + describe '#to_ability_name' do + it 'returns milestone' do + milestone = build(:milestone) + + expect(milestone.to_ability_name).to eq('milestone') + end + end + describe '.search' do let(:milestone) { create(:milestone, title: 'foo', description: 'bar') } diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 9f3313e67b5..be2ea2e63ee 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -4441,6 +4441,14 @@ describe Project do end end + describe '#to_ability_name' do + it 'returns project' do + project = build(:project_empty_repo) + + expect(project.to_ability_name).to eq('project') + end + end + describe '#execute_hooks' do let(:data) { { ref: 'refs/heads/master', data: 'data' } } it 'executes active projects hooks with the specified scope' do |