Skip to content

Commit afe6322

Browse files
Revert "Missed some tests that expected create to use turbo"
This reverts commit 8bf52c7.
1 parent 8bf52c7 commit afe6322

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/requests/distributions_requests_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,23 @@
221221
expect(partner).to be_valid
222222

223223
expect(PartnerMailerJob).to receive(:perform_later).once
224-
post distributions_path(distribution:)
224+
post distributions_path(distribution:, format: :turbo_stream)
225225

226226
expect(response).to have_http_status(:redirect)
227227
last_distribution = Distribution.last
228228
expect(response).to redirect_to(distribution_path(last_distribution))
229229
end
230230

231231
it "renders #new again on failure, with notice" do
232-
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil })
232+
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }, format: :turbo_stream)
233233
expect(response).to have_http_status(400)
234234
expect(response).to have_error
235235
end
236236

237237
it "renders #new with item quantities in dropdowns listed" do
238238
create(:item, :with_unit, organization: organization, name: 'Item 1', unit: 'pack')
239239

240-
post distributions_path(distribution: distribution.except(:partner_id))
240+
post distributions_path(distribution: distribution.except(:partner_id), format: :turbo_stream)
241241

242242
expect(response).to have_http_status(400)
243243
expect(flash[:error]).to include("Sorry, we weren't able to save the distribution.")
@@ -249,7 +249,7 @@
249249
create(:item, organization: organization, name: 'Active Item')
250250
create(:item, :inactive, organization: organization, name: 'Inactive Item')
251251

252-
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil })
252+
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }, format: :turbo_stream)
253253
expect(response).to have_http_status(400)
254254

255255
page = Nokogiri::HTML(response.body)
@@ -266,7 +266,7 @@
266266
end
267267

268268
it "should not display deactivated partners after error and re-render of form" do
269-
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil })
269+
post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }, format: :turbo_stream)
270270
expect(response).to have_http_status(400)
271271
expect(response).to have_error
272272
expect(response.body).not_to include("Deactivated Partner")
@@ -278,7 +278,7 @@
278278
let(:issued_at) { "" }
279279

280280
it "fails and returns validation error message" do
281-
post distributions_path(distribution:)
281+
post distributions_path(distribution:, format: :turbo_stream)
282282

283283
expect(response).to have_http_status(400)
284284
expect(flash[:error]).to include("Distribution date and time can't be blank")

0 commit comments

Comments
 (0)