Merge branch 'next-minor' into develop

This commit is contained in:
Dennis Schubert 2016-11-06 02:41:46 +01:00
commit 8fb17f8e2c
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
4 changed files with 22 additions and 0 deletions

View file

@ -12,6 +12,8 @@ module ApplicationHelper
end end
def changelog_url def changelog_url
return AppConfig.settings.changelog_url.get if AppConfig.settings.changelog_url.present?
url = "https://github.com/diaspora/diaspora/blob/master/Changelog.md" url = "https://github.com/diaspora/diaspora/blob/master/Changelog.md"
url.sub!('/master/', "/#{AppConfig.git_revision}/") if AppConfig.git_revision.present? url.sub!('/master/', "/#{AppConfig.git_revision}/") if AppConfig.git_revision.present?
url url

View file

@ -144,6 +144,7 @@ defaults:
warn_days: 30 warn_days: 30
limit_removals_to_per_day: 100 limit_removals_to_per_day: 100
source_url: source_url:
changelog_url:
default_color_theme: "original" default_color_theme: "original"
default_metas: default_metas:
title: 'diaspora* social network' title: 'diaspora* social network'

View file

@ -535,6 +535,11 @@ configuration: ## Section
## If not set your pod will provide a downloadable archive. ## If not set your pod will provide a downloadable archive.
#source_url: 'https://example.org/username/diaspora' #source_url: 'https://example.org/username/diaspora'
## Changelog URL
## URL to the changelog of the diaspora-version your pod is currently running.
## If not set an auto-generated url to github is used.
#changelog_url: "https://github.com/diaspora/diaspora/blob/master/Changelog.md"
## Default color theme ## Default color theme
## You can change which color theme is displayed when a user is not signed in ## You can change which color theme is displayed when a user is not signed in
## or has not selected any color theme from the available ones. You simply have ## or has not selected any color theme from the available ones. You simply have

View file

@ -89,15 +89,29 @@ describe ApplicationHelper, :type => :helper do
end end
describe "#changelog_url" do describe "#changelog_url" do
let(:changelog_url_setting) {
double.tap {|double| allow(AppConfig).to receive(:settings).and_return(double(changelog_url: double)) }
}
it "defaults to master branch changleog" do it "defaults to master branch changleog" do
expect(changelog_url_setting).to receive(:present?).and_return(false)
expect(AppConfig).to receive(:git_revision).and_return(nil) expect(AppConfig).to receive(:git_revision).and_return(nil)
expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/master/Changelog.md") expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/master/Changelog.md")
end end
it "displays the changelog for the current git revision if set" do it "displays the changelog for the current git revision if set" do
expect(changelog_url_setting).to receive(:present?).and_return(false)
expect(AppConfig).to receive(:git_revision).twice.and_return("123") expect(AppConfig).to receive(:git_revision).twice.and_return("123")
expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/123/Changelog.md") expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/123/Changelog.md")
end end
it "displays the configured changelog url if set" do
expect(changelog_url_setting).to receive(:present?).and_return(true)
expect(changelog_url_setting).to receive(:get)
.and_return("https://github.com/diaspora/diaspora/blob/develop/Changelog.md")
expect(AppConfig).not_to receive(:git_revision)
expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/develop/Changelog.md")
end
end end
describe '#pod_name' do describe '#pod_name' do