diff --git a/lib/configuration_methods.rb b/lib/configuration_methods.rb index 6d5c1f503fb37c41a31e8259a8db11cefc8d7098..fc085afdd5cc067a186c768f037d326d75ec71ad 100644 --- a/lib/configuration_methods.rb +++ b/lib/configuration_methods.rb @@ -89,13 +89,11 @@ module Configuration get_git_info if git_available? @git_revision end - attr_writer :git_revision def git_update get_git_info if git_available? @git_update end - attr_writer :git_update def rails_asset_id (git_revision || version)[0..8] diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 8ce0ea39cac73d836d43f5abfa1cdd70419dfd3f..dae93ace1bc380cbd797e1882d3d226b8ea41957 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -88,17 +88,16 @@ describe ApplicationHelper, :type => :helper do end end - describe '#changelog_url' do - it 'defaults to master branch changleog' do - AppConfig.git_revision = nil - expect(changelog_url).to eq('https://github.com/diaspora/diaspora/blob/master/Changelog.md') + describe "#changelog_url" do + it "defaults to master branch changleog" do + expect(AppConfig).to receive(:git_revision).and_return(nil) + expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/master/Changelog.md") end - it 'displays the changelog for the current git revision if set' do - AppConfig.git_revision = '123' - expect(changelog_url).to eq('https://github.com/diaspora/diaspora/blob/123/Changelog.md') + it "displays the changelog for the current git revision if set" do + expect(AppConfig).to receive(:git_revision).twice.and_return("123") + expect(changelog_url).to eq("https://github.com/diaspora/diaspora/blob/123/Changelog.md") end - end describe '#pod_name' do @@ -108,7 +107,6 @@ describe ApplicationHelper, :type => :helper do it 'displays the supplied pod_name if it is set' do AppConfig.settings.pod_name = "Catspora" - # require 'pry'; binding.pry expect(pod_name).to match "Catspora" end end