Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-18 05:00:36 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-18 05:00:36 +0300
commit52acd2b45c3676bae3cb9a1c008e4deada3ca840 (patch)
tree0f7f4ac228cf4cd3623f1d1474017a7facb47cf7 /spec
parentcc4a3b6b620240b72d4138b4e210c047899ac2b3 (diff)
parent7ff9c8229d8df09be5927086222aad0cd5d71477 (diff)
Merge branch 'external_wiki' into 'master'
Add support for external wikis ## What does this MR do? This MR adds the possibility to replace the link to the internal wiki of gitlab with a custom link. Currently this is realised as a service. ## What Use Case does this MR solve? In my Company we already have a wiki System (Confluence). We have a policy to use the existing wiki, so we can't switch to the internal wiki Gitlab provides. This currently only leaves us two choices: 1. Disable the gitlab wiki. That means we completly loose the connection between wiki and code from the gitlab ui. 2. Create a simple wiki page with a link to our external wiki and hope that no one uses the internal one. Both solutions are not really good. So what can be done to improve the situation while making it as easy as possible for new developers to access both, wiki and gitlab? Replacing the wiki link kinda like the JIRA integration replaces the issues link looks like a good first step to me. :) This can probably be extended later to completly prevent access to the internal wiki (currently that's still possible if you know the link) or maybe to check if the link really points to a wiki. ## Screenshot: ![external_wiki_service](https://gitlab.com/uploads/gitlab-org/gitlab-ce/89b27cf068/external_wiki_service.png) See merge request !291
Diffstat (limited to 'spec')
-rw-r--r--spec/models/external_wiki_service_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/models/external_wiki_service_spec.rb b/spec/models/external_wiki_service_spec.rb
new file mode 100644
index 00000000000..78ef687d29c
--- /dev/null
+++ b/spec/models/external_wiki_service_spec.rb
@@ -0,0 +1,39 @@
+require 'spec_helper'
+
+describe ExternalWikiService do
+ include ExternalWikiHelper
+ describe "Associations" do
+ it { should belong_to :project }
+ it { should have_one :service_hook }
+ end
+
+ describe "Validations" do
+ context "active" do
+ before do
+ subject.active = true
+ end
+
+ it { should validate_presence_of :external_wiki_url }
+ end
+ end
+
+ describe 'External wiki' do
+ let(:project) { create(:project) }
+
+ context 'when it is active' do
+ before do
+ properties = { 'external_wiki_url' => 'https://gitlab.com' }
+ @service = project.create_external_wiki_service(active: true, properties: properties)
+ end
+
+ after do
+ @service.destroy!
+ end
+
+ it 'should replace the wiki url' do
+ wiki_path = get_project_wiki_path(project)
+ wiki_path.should match('https://gitlab.com')
+ end
+ end
+ end
+end