Commit af3243cb by Pedro Moreira Committed by Tute Costa

Correct attachment processing spec (#2201)

This is part of the effort started at
https://github.com/thoughtbot/paperclip/issues/2199 to ensure the test
suite is green locally.

The attachment processing spec was failing since the setup required done
in a before block, namely a call to `rebuild_class`, was running
restricted to one of two contexts in the test file.
This was leaving the `Dummy` class in a bad state and affected other tests.

This PR moves the `before` block to run for the both of the contexts.
parent e79a3095
......@@ -2,11 +2,9 @@
require 'spec_helper'
describe 'Attachment Processing' do
context 'using validates_attachment_content_type' do
before do
rebuild_class
end
before { rebuild_class }
context 'using validates_attachment_content_type' do
it 'processes attachments given a valid assignment' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment_content_type :avatar, content_type: "image/png"
......
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