Fix can't modify frozen String errors

Use unary plus as recommended by Performance/UnfreezeString cop
This commit is contained in:
Thong Kuah 2019-07-25 22:53:43 +12:00
parent 73e848850c
commit 8be61f7695
4 changed files with 4 additions and 4 deletions

View File

@ -93,7 +93,7 @@ describe 'Dashboard Issues Calendar Feed' do
expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
# line length for ics is 75 chars
expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, ' ')
expected_description = (+"DESCRIPTION:Find out more at #{issue_url(issue)}").insert(75, ' ')
expect(body).to have_text(expected_description)
expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
expect(body).to have_text("URL:#{issue_url(issue)}")

View File

@ -68,7 +68,7 @@ describe 'Group Issues Calendar Feed' do
expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
# line length for ics is 75 chars
expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, ' ')
expected_description = (+"DESCRIPTION:Find out more at #{issue_url(issue)}").insert(75, ' ')
expect(body).to have_text(expected_description)
expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
expect(body).to have_text("URL:#{issue_url(issue)}")

View File

@ -67,7 +67,7 @@ describe 'Project Issues Calendar Feed' do
expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
# line length for ics is 75 chars
expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, ' ')
expected_description = (+"DESCRIPTION:Find out more at #{issue_url(issue)}").insert(75, ' ')
expect(body).to have_text(expected_description)
expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
expect(body).to have_text("URL:#{issue_url(issue)}")

View File

@ -131,7 +131,7 @@ describe 'User views a wiki page' do
end
context 'when page has invalid content encoding' do
let(:content) { 'whatever'.force_encoding('ISO-8859-1') }
let(:content) { (+'whatever').force_encoding('ISO-8859-1') }
before do
allow(Gitlab::EncodingHelper).to receive(:encode!).and_return(content)