Update spec failure when running on forks#24027
Update spec failure when running on forks#24027nschonni wants to merge 1 commit intomastodon:mainfrom
Conversation
| it 'returns "https://github.com/mastodon/mastodon"' do | ||
| expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon') | ||
| it 'returns the repo address' do | ||
| expect(instance_presenter.source_url).to eq("https://github.com/#{ENV.fetch('GITHUB_REPOSITORY')}") |
There was a problem hiding this comment.
I think this will fix the CI environment where that env var is set, but will break local runs where the env var is not set.
It looks like the implementation tries to use the env var if set, and then falls back to mastodon/mastodon if not set.
One way to resolve this would be to split this spec into two contexts -- one with the env var set and one without the env var set; but instead of relying on it just happening to be present or not in the env its being run in, use an rspec around block to explicitly set/unset the var for those conditions, and have the spec verify we're getting the expected result in each case.
|
That is an interesting side-effect of migrating tests to GitHub… The variable wasn't set when running on CircleCI. |
|
Superseded by #24036 |
Not sure this is the best fix, but it was annoying that this test would always fail when pushing to my fork. Seemed a little better than just commenting it out, but maybe @mjankowski has a better idea