Merge pull request #6869 from SuperTux88/fix-changelog_url-spec

fix spec for ApplicationHelper#changelog_url
This commit is contained in:
Dennis Schubert 2016-06-19 01:02:27 +02:00 committed by GitHub
commit 2e2671120c
2 changed files with 7 additions and 11 deletions

View file

@ -89,13 +89,11 @@ module Configuration
get_git_info if git_available? get_git_info if git_available?
@git_revision @git_revision
end end
attr_writer :git_revision
def git_update def git_update
get_git_info if git_available? get_git_info if git_available?
@git_update @git_update
end end
attr_writer :git_update
def rails_asset_id def rails_asset_id
(git_revision || version)[0..8] (git_revision || version)[0..8]

View file

@ -88,17 +88,16 @@ describe ApplicationHelper, :type => :helper do
end end
end end
describe '#changelog_url' do describe "#changelog_url" do
it 'defaults to master branch changleog' do it "defaults to master branch changleog" do
AppConfig.git_revision = 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
AppConfig.git_revision = '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
end end
describe '#pod_name' do describe '#pod_name' do
@ -108,7 +107,6 @@ describe ApplicationHelper, :type => :helper do
it 'displays the supplied pod_name if it is set' do it 'displays the supplied pod_name if it is set' do
AppConfig.settings.pod_name = "Catspora" AppConfig.settings.pod_name = "Catspora"
# require 'pry'; binding.pry
expect(pod_name).to match "Catspora" expect(pod_name).to match "Catspora"
end end
end end