|
221 | 221 | expect(partner).to be_valid |
222 | 222 |
|
223 | 223 | expect(PartnerMailerJob).to receive(:perform_later).once |
224 | | - post distributions_path(distribution:, format: :turbo_stream) |
| 224 | + post distributions_path(distribution:) |
225 | 225 |
|
226 | 226 | expect(response).to have_http_status(:redirect) |
227 | 227 | last_distribution = Distribution.last |
228 | 228 | expect(response).to redirect_to(distribution_path(last_distribution)) |
229 | 229 | end |
230 | 230 |
|
231 | 231 | it "renders #new again on failure, with notice" do |
232 | | - post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }, format: :turbo_stream) |
| 232 | + post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }) |
233 | 233 | expect(response).to have_http_status(400) |
234 | 234 | expect(response).to have_error |
235 | 235 | end |
236 | 236 |
|
237 | 237 | it "renders #new with item quantities in dropdowns listed" do |
238 | 238 | create(:item, :with_unit, organization: organization, name: 'Item 1', unit: 'pack') |
239 | 239 |
|
240 | | - post distributions_path(distribution: distribution.except(:partner_id), format: :turbo_stream) |
| 240 | + post distributions_path(distribution: distribution.except(:partner_id)) |
241 | 241 |
|
242 | 242 | expect(response).to have_http_status(400) |
243 | 243 | expect(flash[:error]).to include("Sorry, we weren't able to save the distribution.") |
|
249 | 249 | create(:item, organization: organization, name: 'Active Item') |
250 | 250 | create(:item, :inactive, organization: organization, name: 'Inactive Item') |
251 | 251 |
|
252 | | - post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }, format: :turbo_stream) |
| 252 | + post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }) |
253 | 253 | expect(response).to have_http_status(400) |
254 | 254 |
|
255 | 255 | page = Nokogiri::HTML(response.body) |
|
266 | 266 | end |
267 | 267 |
|
268 | 268 | 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 }, format: :turbo_stream) |
| 269 | + post distributions_path(distribution: { comment: nil, partner_id: nil, storage_location_id: nil }) |
270 | 270 | expect(response).to have_http_status(400) |
271 | 271 | expect(response).to have_error |
272 | 272 | expect(response.body).not_to include("Deactivated Partner") |
|
278 | 278 | let(:issued_at) { "" } |
279 | 279 |
|
280 | 280 | it "fails and returns validation error message" do |
281 | | - post distributions_path(distribution:, format: :turbo_stream) |
| 281 | + post distributions_path(distribution:) |
282 | 282 |
|
283 | 283 | expect(response).to have_http_status(400) |
284 | 284 | expect(flash[:error]).to include("Distribution date and time can't be blank") |
|
0 commit comments