require'spec_helper'describeBugzillaService,models: truedodescribe'Associations'doit{is_expected.tobelong_to:project}it{is_expected.tohave_one:service_hook}enddescribe'Validations'docontext'when service is active'dobefore{subject.active=true}it{is_expected.tovalidate_presence_of(:project_url)}it{is_expected.tovalidate_presence_of(:issues_url)}it{is_expected.tovalidate_presence_of(:new_issue_url)}it_behaves_like'issue tracker service URL attribute',:project_urlit_behaves_like'issue tracker service URL attribute',:issues_urlit_behaves_like'issue tracker service URL attribute',:new_issue_urlendcontext'when service is inactive'dobefore{subject.active=false}it{is_expected.not_tovalidate_presence_of(:project_url)}it{is_expected.not_tovalidate_presence_of(:issues_url)}it{is_expected.not_tovalidate_presence_of(:new_issue_url)}endendend