Merge remote-tracking branch 'parent/main' into kb_migration

This commit is contained in:
KMY 2023-03-10 11:44:31 +09:00
commit 3d49bb52c8
4 changed files with 25 additions and 2 deletions

View file

@ -117,6 +117,7 @@ end
group :test do
gem 'capybara', '~> 3.38'
gem 'climate_control'
gem 'faker', '~> 3.1'
gem 'json-schema', '~> 3.0'
gem 'rack-test', '~> 2.0'

View file

@ -784,6 +784,7 @@ DEPENDENCIES
capybara (~> 3.38)
charlock_holmes (~> 0.7.7)
chewy (~> 7.2)
climate_control
cocoon (~> 1.2)
color_diff (~> 0.1)
concurrent-ruby

View file

@ -4552,6 +4552,7 @@ a.status-card.compact:hover {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: $secondary-text-color;
font-size: 18px;
font-weight: 500;

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