describe Symphonia::AttachmentsController, logged: true do let!(:file) { FactoryBot.create(:file) } let(:images) { FactoryBot.create_list(:image, 3, attachable_id: nil, attachable_type: nil) } it '#show' do get symphonia.attachment_path(file) expect(response.body).to match file.attachment.url(:original) end it '#destroy' do expect{ delete(symphonia.attachment_path(file)) }.to change(Symphonia::Attachment, :count).by -1 end it '#reorder', pending: "When `identify` missing" do expect { images }.to change(Symphonia::Image, :count).by 3 patch symphonia.reorder_attachment_path images.last, 1 expect(response).to have_http_status :success imgs = Symphonia::Image.order(:position).to_a expect(imgs.first.id).to be > imgs.last.id end end