Merge commit '82e477b184b5666fff7fb55933dce22ca2925db8' into glitch-soc/merge-upstream

Conflicts:
- `db/migrate/20180831171112_create_bookmarks.rb`:
  Upstream ran a lint fix on this file, but this file is different in
  glitch-soc because the feature was added much earlier.
  Ran the lint fix on our own version of the file.
This commit is contained in:
Claire
2023-07-12 16:03:05 +02:00
458 changed files with 1117 additions and 853 deletions

View File

@@ -23,7 +23,7 @@ describe StatusFilter do
context 'when status policy does not allow show' do
it 'filters the status' do
expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
allow_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
expect(filter).to be_filtered
end
@@ -74,7 +74,7 @@ describe StatusFilter do
context 'when status policy does not allow show' do
it 'filters the status' do
expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
allow_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
expect(filter).to be_filtered
end

View File

@@ -18,10 +18,13 @@ describe StatusFinder do
it 'raises an error if action is not :show' do
recognized = Rails.application.routes.recognize_path(url)
expect(recognized).to receive(:[]).with(:action).and_return(:create)
expect(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized)
allow(recognized).to receive(:[]).with(:action).and_return(:create)
allow(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized)
expect { subject.status }.to raise_error(ActiveRecord::RecordNotFound)
expect(Rails.application.routes).to have_received(:recognize_path)
expect(recognized).to have_received(:[])
end
end

View File

@@ -27,13 +27,14 @@ describe WebfingerResource do
recognized = Rails.application.routes.recognize_path(resource)
allow(recognized).to receive(:[]).with(:controller).and_return('accounts')
allow(recognized).to receive(:[]).with(:username).and_return('alice')
expect(recognized).to receive(:[]).with(:action).and_return('create')
allow(recognized).to receive(:[]).with(:action).and_return('create')
expect(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized).at_least(:once)
expect do
described_class.new(resource).username
end.to raise_error(ActiveRecord::RecordNotFound)
expect(recognized).to have_received(:[]).exactly(3).times
end
it 'raises with a string that doesnt start with URL' do