Sha256: 5753e568555661f16167dc0fe061d75ada54319b7751f43279a0f01a2eeea1e9
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
describe ContentDeleteEventJob do let(:user) { create(:user) } let(:mock_time) { Time.zone.at(1) } let(:event) do { action: "User <a href=\"/users/#{user.to_param}\">#{user.user_key}</a> has deleted object '#{curation_concern.id}'", timestamp: '1' } end before do allow(Time).to receive(:now).and_return(mock_time) end context 'with a FileSet' do let(:curation_concern) { create(:file_set, title: ['Hamlet'], user: user) } it "logs the event to the depositor's profile" do expect do described_class.perform_now(curation_concern.id, user) end.to change { user.profile_events.length }.by(1) expect(user.profile_events.first).to eq(event) end end context 'with a Work' do let(:curation_concern) { create(:generic_work, title: ['BethsMac'], user: user) } it "logs the event to the depositor's profile" do expect do described_class.perform_now(curation_concern.id, user) end.to change { user.profile_events.length }.by(1) expect(user.profile_events.first).to eq(event) end end end
Version data entries
18 entries across 18 versions & 3 rubygems