Skip to content
Snippets Groups Projects
Commit 67974f1d authored by Tiago Botelho's avatar Tiago Botelho
Browse files

remove invalid services

parent 3ff8d802
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -26,6 +26,7 @@ class Service < ActiveRecord::Base
has_one :service_hook
 
validates :project_id, presence: true, unless: proc { |service| service.template? }
validates :type, presence: true
 
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
scope :issue_trackers, -> { where(category: 'issue_tracker') }
Loading
Loading
Loading
Loading
@@ -6,6 +6,10 @@ describe Service, models: true do
it { is_expected.to have_one :service_hook }
end
 
describe 'Validations' do
it { is_expected.to validate_presence_of(:type).on(:create) }
end
describe "Test Button" do
before do
@service = Service.new
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment