Explicitly set github repo in instance presenter spec (#24036)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2023-03-09 14:27:48 +01:00
1 parent 684a970b3c
commit 2f7a663b0b
3 files changed
+24 -2

No files matched your search

+22 -2
View File
@@ -89,8 +89,28 @@ describe InstancePresenter do
end
describe '#source_url' do
it 'returns "https://github.com/mastodon/mastodon"' do
expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon')
context 'with the GITHUB_REPOSITORY env variable set' do
around do |example|
ClimateControl.modify GITHUB_REPOSITORY: 'other/repo' do
example.run
end
end
it 'uses the env variable to build a repo URL' do
expect(instance_presenter.source_url).to eq('https://github.com/other/repo')
end
end
context 'without the GITHUB_REPOSITORY env variable set' do
around do |example|
ClimateControl.modify GITHUB_REPOSITORY: nil do
example.run
end
end
it 'defaults to the core mastodon repo URL' do
expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon')
end
end
end