summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-10-24 10:35:21 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2017-10-24 10:35:21 +0300
commitcc5ba3d907c42175b70d3374c3772d0d25d12080 (patch)
treedd987308030253c90000cf7027ec6f230c840e56 /spec/models
parent82446a2bd009e7d7481c35a142063a3973be77ce (diff)
downloadgitlab-ce-cc5ba3d907c42175b70d3374c3772d0d25d12080.tar.gz
Validate username/pw for Jiraservice, require them in the API
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_services/jira_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index 63bf131cfc5..ad22fb2a386 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -24,6 +24,8 @@ describe JiraService do
end
it { is_expected.not_to validate_presence_of(:url) }
+ it { is_expected.not_to validate_presence_of(:username) }
+ it { is_expected.not_to validate_presence_of(:password) }
end
context 'validating urls' do
@@ -54,6 +56,18 @@ describe JiraService do
expect(service).not_to be_valid
end
+ it 'is not valid when username is missing' do
+ service.username = nil
+
+ expect(service).not_to be_valid
+ end
+
+ it 'is not valid when password is missing' do
+ service.password = nil
+
+ expect(service).not_to be_valid
+ end
+
it 'is valid when api url is a valid url' do
service.api_url = 'http://jira.test.com/api'