Commit 8feba017 authored by Sean McGivern's avatar Sean McGivern

Fix specs in Ruby 2.1

Ruby 2.1 requires a basename argument to `Tempfile.open`, so just call
it something that makes sense in context for the spec.
parent 45bd2263
...@@ -7,7 +7,7 @@ describe Gitlab::Middleware::Multipart do ...@@ -7,7 +7,7 @@ describe Gitlab::Middleware::Multipart do
let(:middleware) { described_class.new(app) } let(:middleware) { described_class.new(app) }
it 'opens top-level files' do it 'opens top-level files' do
Tempfile.open do |tempfile| Tempfile.open('top-level') do |tempfile|
env = post_env({ 'file' => tempfile.path }, { 'file.name' => 'filename' }, Gitlab::Workhorse.secret, 'gitlab-workhorse') env = post_env({ 'file' => tempfile.path }, { 'file.name' => 'filename' }, Gitlab::Workhorse.secret, 'gitlab-workhorse')
expect(app).to receive(:call) do |env| expect(app).to receive(:call) do |env|
...@@ -33,7 +33,7 @@ describe Gitlab::Middleware::Multipart do ...@@ -33,7 +33,7 @@ describe Gitlab::Middleware::Multipart do
end end
it 'opens files one level deep' do it 'opens files one level deep' do
Tempfile.open do |tempfile| Tempfile.open('one-level') do |tempfile|
in_params = { 'user' => { 'avatar' => { '.name' => 'filename' } } } in_params = { 'user' => { 'avatar' => { '.name' => 'filename' } } }
env = post_env({ 'user[avatar]' => tempfile.path }, in_params, Gitlab::Workhorse.secret, 'gitlab-workhorse') env = post_env({ 'user[avatar]' => tempfile.path }, in_params, Gitlab::Workhorse.secret, 'gitlab-workhorse')
...@@ -48,7 +48,7 @@ describe Gitlab::Middleware::Multipart do ...@@ -48,7 +48,7 @@ describe Gitlab::Middleware::Multipart do
end end
it 'opens files two levels deep' do it 'opens files two levels deep' do
Tempfile.open do |tempfile| Tempfile.open('two-levels') do |tempfile|
in_params = { 'project' => { 'milestone' => { 'themesong' => { '.name' => 'filename' } } } } in_params = { 'project' => { 'milestone' => { 'themesong' => { '.name' => 'filename' } } } }
env = post_env({ 'project[milestone][themesong]' => tempfile.path }, in_params, Gitlab::Workhorse.secret, 'gitlab-workhorse') env = post_env({ 'project[milestone][themesong]' => tempfile.path }, in_params, Gitlab::Workhorse.secret, 'gitlab-workhorse')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment