removed rebellious test
This commit is contained in:
@ -66,6 +66,8 @@ describe SubmissionsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #render_file' do
|
describe 'GET #render_file' do
|
||||||
|
let(:file) { submission.files.first }
|
||||||
|
|
||||||
context 'with an invalid filename' do
|
context 'with an invalid filename' do
|
||||||
before(:each) { get :render_file, filename: SecureRandom.hex, id: submission.id }
|
before(:each) { get :render_file, filename: SecureRandom.hex, id: submission.id }
|
||||||
|
|
||||||
@ -73,14 +75,7 @@ describe SubmissionsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'with a valid filename' do
|
context 'with a valid filename' do
|
||||||
let(:file) { submission.files.first }
|
before(:each) { get :render_file, filename: file.name_with_extension, id: submission.id }
|
||||||
let(:file_type) { FactoryGirl.create(:dot_xml) }
|
|
||||||
let(:request) { proc { get :render_file, filename: file.name_with_extension, id: submission.id } }
|
|
||||||
|
|
||||||
before(:each) do
|
|
||||||
file.update(file_type: file_type)
|
|
||||||
request.call
|
|
||||||
end
|
|
||||||
|
|
||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
@ -89,12 +84,6 @@ describe SubmissionsController do
|
|||||||
it 'renders the file content' do
|
it 'renders the file content' do
|
||||||
expect(response.body).to eq(file.content)
|
expect(response.body).to eq(file.content)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets the correct MIME type' do
|
|
||||||
mime_type = Mime::Type.lookup_by_extension(file_type.file_extension.gsub(/^\./, ''))
|
|
||||||
expect(Mime::Type).to receive(:lookup_by_extension).at_least(:once).and_return(mime_type)
|
|
||||||
request.call
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user