Run rubocop --fix-layout and remove encoding comments

This commit is contained in:
Patrick Gansterer 2021-03-01 15:27:26 +01:00
parent fa63e6e81d
commit ea2862fdef
283 changed files with 1164 additions and 1969 deletions

View file

@ -17,7 +17,7 @@ describe BankTransaction do
JSON
importer = BankAccountInformationImporter.new(bank_account)
expect{importer.import!(content)}.to raise_error(JSON::ParserError)
expect { importer.import!(content) }.to raise_error(JSON::ParserError)
end
it 'empty object' do

View file

@ -92,5 +92,4 @@ describe BankTransactionReference do
it 'returns correct value for FS34.56A67.89 with prefix and suffix' do
expect(BankTransactionReference.parse('prefix FS34.56A67.89, suffix')).to match({ group: 34, user: 56, parts: { "A" => 67.89 } })
end
end

View file

@ -95,5 +95,4 @@ describe FoodsoftConfig do
expect(FoodsoftConfig[:protected]['database']).to eq FoodsoftConfig[:protected][:database]
end
end
end

View file

@ -1,7 +1,6 @@
require_relative '../spec_helper'
describe FoodsoftMailReceiver do
before :all do
@server = FoodsoftMailReceiver.new 2525, '127.0.0.1', 4, logger_severity: 5
@server.start
@ -75,5 +74,4 @@ describe FoodsoftMailReceiver do
after :all do
@server.shutdown
end
end

View file

@ -6,12 +6,12 @@ describe TokenVerifier do
let (:msg) { v.generate }
it 'validates' do
expect{ v.verify(msg) }.to_not raise_error
expect { v.verify(msg) }.to_not raise_error
end
it 'validates when recreated' do
v2 = TokenVerifier.new(prefix)
expect{ v2.verify(msg) }.to_not raise_error
expect { v2.verify(msg) }.to_not raise_error
end
it 'does not validate with a different prefix' do
@ -25,20 +25,19 @@ describe TokenVerifier do
begin
FoodsoftConfig.scope = Faker::Lorem.words(number: 1)
v2 = TokenVerifier.new(prefix)
expect{ v2.verify(msg) }.to raise_error(TokenVerifier::InvalidScope)
expect { v2.verify(msg) }.to raise_error(TokenVerifier::InvalidScope)
ensure
FoodsoftConfig.scope = oldscope
end
end
it 'does not validate a random string' do
expect{ v.verify(Faker::Lorem.characters(number: 100)) }.to raise_error(ActiveSupport::MessageVerifier::InvalidSignature)
expect { v.verify(Faker::Lorem.characters(number: 100)) }.to raise_error(ActiveSupport::MessageVerifier::InvalidSignature)
end
it 'returns the message' do
data = [5, {'hi' => :there}, 'bye', []]
data = [5, { 'hi' => :there }, 'bye', []]
msg = v.generate(data)
expect(v.verify(msg)).to eq data
end
end