Revert 855208a293
.
This causes conflicts with the way the instance variable `@file` in the test file works with the scope of `mock_app`. Without assigning the `@file` instance variable to a temporary variable—in this case `path`—we won't be able to access the instance var inside the mock_app > get context.
This commit is contained in:
parent
855208a293
commit
a4dc2ea93c
|
@ -778,9 +778,10 @@ class HelpersTest < Minitest::Test
|
|||
end
|
||||
|
||||
def send_file_app(opts={})
|
||||
path = @file
|
||||
mock_app {
|
||||
get '/file.txt' do
|
||||
send_file @file, opts
|
||||
send_file path, opts
|
||||
end
|
||||
}
|
||||
end
|
||||
|
@ -882,10 +883,11 @@ class HelpersTest < Minitest::Test
|
|||
end
|
||||
|
||||
it "does not override Content-Type if already set and no explicit type is given" do
|
||||
path = @file
|
||||
mock_app do
|
||||
get('/') do
|
||||
content_type :png
|
||||
send_file @file
|
||||
send_file path
|
||||
end
|
||||
end
|
||||
get '/'
|
||||
|
@ -893,10 +895,11 @@ class HelpersTest < Minitest::Test
|
|||
end
|
||||
|
||||
it "does override Content-Type even if already set, if explicit type is given" do
|
||||
path = @file
|
||||
mock_app do
|
||||
get('/') do
|
||||
content_type :png
|
||||
send_file @file, :type => :gif
|
||||
send_file path, :type => :gif
|
||||
end
|
||||
end
|
||||
get '/'
|
||||
|
@ -904,9 +907,10 @@ class HelpersTest < Minitest::Test
|
|||
end
|
||||
|
||||
it 'can have :status option as a string' do
|
||||
path = @file
|
||||
mock_app do
|
||||
post '/' do
|
||||
send_file @file, :status => '422'
|
||||
send_file path, :status => '422'
|
||||
end
|
||||
end
|
||||
post '/'
|
||||
|
|
Loading…
Reference in New Issue