|
|
@ -25,7 +25,7 @@ describe Admin::ReportNotesController do
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id }, create_and_resolve: nil } }
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id }, create_and_resolve: nil } }
|
|
|
|
|
|
|
|
|
|
|
|
it 'creates a report note and resolves report' do
|
|
|
|
it 'creates a report note and resolves report' do
|
|
|
|
expect { subject }.to change { ReportNote.count }.by(1)
|
|
|
|
expect { subject }.to change(ReportNote, :count).by(1)
|
|
|
|
expect(report.reload).to be_action_taken
|
|
|
|
expect(report.reload).to be_action_taken
|
|
|
|
expect(subject).to redirect_to admin_reports_path
|
|
|
|
expect(subject).to redirect_to admin_reports_path
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -35,7 +35,7 @@ describe Admin::ReportNotesController do
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id } } }
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id } } }
|
|
|
|
|
|
|
|
|
|
|
|
it 'creates a report note and does not resolve report' do
|
|
|
|
it 'creates a report note and does not resolve report' do
|
|
|
|
expect { subject }.to change { ReportNote.count }.by(1)
|
|
|
|
expect { subject }.to change(ReportNote, :count).by(1)
|
|
|
|
expect(report.reload).to_not be_action_taken
|
|
|
|
expect(report.reload).to_not be_action_taken
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -50,7 +50,7 @@ describe Admin::ReportNotesController do
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id }, create_and_unresolve: nil } }
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id }, create_and_unresolve: nil } }
|
|
|
|
|
|
|
|
|
|
|
|
it 'creates a report note and unresolves report' do
|
|
|
|
it 'creates a report note and unresolves report' do
|
|
|
|
expect { subject }.to change { ReportNote.count }.by(1)
|
|
|
|
expect { subject }.to change(ReportNote, :count).by(1)
|
|
|
|
expect(report.reload).to_not be_action_taken
|
|
|
|
expect(report.reload).to_not be_action_taken
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -60,7 +60,7 @@ describe Admin::ReportNotesController do
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id } } }
|
|
|
|
let(:params) { { report_note: { content: 'test content', report_id: report.id } } }
|
|
|
|
|
|
|
|
|
|
|
|
it 'creates a report note and does not unresolve report' do
|
|
|
|
it 'creates a report note and does not unresolve report' do
|
|
|
|
expect { subject }.to change { ReportNote.count }.by(1)
|
|
|
|
expect { subject }.to change(ReportNote, :count).by(1)
|
|
|
|
expect(report.reload).to be_action_taken
|
|
|
|
expect(report.reload).to be_action_taken
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
expect(subject).to redirect_to admin_report_path(report)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -85,7 +85,7 @@ describe Admin::ReportNotesController do
|
|
|
|
let!(:report_note) { Fabricate(:report_note) }
|
|
|
|
let!(:report_note) { Fabricate(:report_note) }
|
|
|
|
|
|
|
|
|
|
|
|
it 'deletes note' do
|
|
|
|
it 'deletes note' do
|
|
|
|
expect { subject }.to change { ReportNote.count }.by(-1)
|
|
|
|
expect { subject }.to change(ReportNote, :count).by(-1)
|
|
|
|
expect(subject).to redirect_to admin_report_path(report_note.report)
|
|
|
|
expect(subject).to redirect_to admin_report_path(report_note.report)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|