Sha256: fadb60581d2b00d959ceb875ee3aef8f69c5e06dc9b7145a569ece1334579993
Contents?: true
Size: 1.15 KB
Versions: 7
Compression:
Stored size: 1.15 KB
Contents
require 'spec_helper' feature 'Editing attached files' do let(:user) { create(:user) } let!(:parent) { create(:work_with_one_file, user: user) } let!(:file_set) { parent.file_sets.first } around do |example| original_adapter = ActiveJob::Base.queue_adapter ActiveJob::Base.queue_adapter = :inline example.run ActiveJob::Base.queue_adapter = original_adapter end before do sign_in user # stub out characterization. Travis doesn't have fits installed, and it's not relevant to the test. expect(CharacterizeJob).to receive(:perform_later) end it 'updates the file' do visit "/concern/generic_works/#{parent.id}" click_link 'Edit' expect(page).to have_content "Updating Attached File to \"Test title\"" attach_file('Upload a file', fixture_file_path('files/image.png')) click_button 'Update Attached File' expect(page).to have_content 'The file A Contained FileSet has been updated.' # TODO: this stuff belongs in an Actor or Controller test: file_set.reload expect(file_set.original_file.original_name).to eq 'image.png' expect(file_set.original_file.mime_type).to eq 'image/png' end end
Version data entries
7 entries across 7 versions & 1 rubygems