Sha256: b5f03572eb922bac197d412b96e98b61ffc6becd150af8394c51ff9f380bdf79
Contents?: true
Size: 753 Bytes
Versions: 8
Compression:
Stored size: 753 Bytes
Contents
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' 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
Version data entries
8 entries across 8 versions & 1 rubygems