mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Fix report specs [SCI-5859]
This commit is contained in:
parent
0e813791fe
commit
5f61c6568d
2 changed files with 8 additions and 8 deletions
|
@ -26,13 +26,15 @@ describe ReportsController, type: :controller do
|
|||
report: { name: 'test report created',
|
||||
description: 'test description created',
|
||||
settings: Report::DEFAULT_SETTINGS },
|
||||
project_content: { experiments: { experiment.id => [my_module1.id] } },
|
||||
project_content: { experiments: [{ id: experiment.id, my_module_ids: [my_module1.id] }] },
|
||||
template_values: [] }
|
||||
end
|
||||
|
||||
it 'calls create activity service' do
|
||||
expect(Activities::CreateActivityService).to receive(:call)
|
||||
.with(hash_including(activity_type: :create_report))
|
||||
.once.with(hash_including(activity_type: :create_report)).ordered
|
||||
expect(Activities::CreateActivityService).to receive(:call)
|
||||
.once.with(hash_including(activity_type: :generate_pdf_report)).ordered
|
||||
action
|
||||
end
|
||||
|
||||
|
@ -51,12 +53,14 @@ describe ReportsController, type: :controller do
|
|||
id: report.id,
|
||||
report: { name: 'test report update',
|
||||
description: 'test description update' },
|
||||
project_content: { experiments: { experiment.id => [my_module2.id] } },
|
||||
project_content: { experiments: [{ id: experiment.id, my_module_ids: [my_module2.id] }] },
|
||||
template_values: [] }
|
||||
end
|
||||
it 'calls create activity service' do
|
||||
expect(Activities::CreateActivityService).to receive(:call)
|
||||
.with(hash_including(activity_type: :edit_report))
|
||||
.once.with(hash_including(activity_type: :edit_report)).ordered
|
||||
expect(Activities::CreateActivityService).to receive(:call)
|
||||
.once.with(hash_including(activity_type: :generate_pdf_report)).ordered
|
||||
action
|
||||
end
|
||||
|
||||
|
|
|
@ -44,9 +44,5 @@ describe Report, type: :model do
|
|||
.is_at_least(Constants::NAME_MIN_LENGTH)
|
||||
.is_at_most(Constants::NAME_MAX_LENGTH)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(report).to validate_uniqueness_of(:name).scoped_to(:user_id, :project_id).case_insensitive
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue