summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-09-26 09:44:37 +0200
committerJames Lopez <james@jameslopez.es>2016-09-26 09:49:05 +0200
commita5b9e1c2604348c7e624b4ee85610c92230551c5 (patch)
tree153df4435fac869df979e40e52129ce21383418d
parenta9f1e972ec12bd628e8fc85388c6ba598902ae25 (diff)
downloadgitlab-ce-a5b9e1c2604348c7e624b4ee85610c92230551c5.tar.gz
added more specs
-rw-r--r--spec/lib/gitlab/import_export/project_tree_saver_spec.rb2
-rw-r--r--spec/models/project_services/custom_issue_tracker_service_spec.rb16
2 files changed, 17 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
index 31a312d6ed5..cf8f2200c57 100644
--- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
@@ -112,7 +112,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
end
it 'saves the correct service type' do
- expect(saved_project_json['services'].first['type']).not_to be_nil
+ expect(saved_project_json['services'].first['type']).to eq('CustomIssueTrackerService')
end
it 'has project feature' do
diff --git a/spec/models/project_services/custom_issue_tracker_service_spec.rb b/spec/models/project_services/custom_issue_tracker_service_spec.rb
index 7020667ea58..63320931e76 100644
--- a/spec/models/project_services/custom_issue_tracker_service_spec.rb
+++ b/spec/models/project_services/custom_issue_tracker_service_spec.rb
@@ -25,5 +25,21 @@ describe CustomIssueTrackerService, models: true do
it { is_expected.not_to validate_presence_of(:issues_url) }
it { is_expected.not_to validate_presence_of(:new_issue_url) }
end
+
+ context 'title' do
+ let(:issue_tracker) { described_class.new(properties: {}) }
+
+ it 'sets a default title' do
+ issue_tracker.title = nil
+
+ expect(issue_tracker.title).to eq('Custom Issue Tracker')
+ end
+
+ it 'sets the custom title' do
+ issue_tracker.title = 'test title'
+
+ expect(issue_tracker.title).to eq('test title')
+ end
+ end
end
end