Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix bcf issues controller spec after status code change to fix turbo

Markus Kahlc78a57be0a5b
diff --git a/modules/bim/spec/controllers/issues_controller_spec.rb b/modules/bim/spec/controllers/issues_controller_spec.rb
index 204e66eaa57..1d4147b2138 100644
--- a/modules/bim/spec/controllers/issues_controller_spec.rb
+++ b/modules/bim/spec/controllers/issues_controller_spec.rb
@@ -112,7 +112,7 @@ RSpec.describe Bim::Bcf::IssuesController do
it "is successful" do
expect { action }.to change { Attachment.count }.by(1)
- expect(response).to be_successful
+ expect(response).to have_http_status 422
end
it_behaves_like "check permissions"
@@ -123,7 +123,8 @@ RSpec.describe Bim::Bcf::IssuesController do
it "redirects back to where we started from" do
expect { action }.not_to change { Attachment.count }
- expect(response).to redirect_to "/projects/bim_project/issues/upload"
+ expect(response).to have_http_status 422
+ expect(response.headers["Location"]).to end_with "/projects/bim_project/issues/upload"
end
end
end
@@ -149,7 +150,7 @@ RSpec.describe Bim::Bcf::IssuesController do
it "is successful" do
expect { action }.not_to change { Attachment.count }
- expect(response).to be_successful
+ expect(response).to have_http_status 422
end
it_behaves_like "check permissions"