Skip to content

Commit

Permalink
[TAN-2512] Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjagit committed Aug 30, 2024
1 parent 880a6b9 commit 8b8b7a4
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'rails_helper'
require 'rspec_api_documentation/dsl'

resource 'Projects' do
before do
@user = create(:admin)
header_token_for @user
header 'Content-Type', 'application/json'
end

delete 'web_api/v1/projects/:id' do
let(:project) { create(:project) }
let!(:idea_import_file1) { create(:idea_import_file, project: project) }
let!(:idea_import_file2) { create(:idea_import_file, project: project, parent: idea_import_file1) }
let(:id) { project.id }

example_request 'Delete a project that has associated idea_import_files' do
expect(response_status).to eq 200
expect { Project.find(id) }.to raise_error(ActiveRecord::RecordNotFound)
expect { BulkImportIdeas::IdeaImportFile.find(idea_import_file1.id) }.to raise_error(ActiveRecord::RecordNotFound)
expect { BulkImportIdeas::IdeaImportFile.find(idea_import_file2.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
end
end

0 comments on commit 8b8b7a4

Please sign in to comment.