|
161 | 161 | CSV |
162 | 162 | expect(response.body).to eq(csv) |
163 | 163 | end |
| 164 | + |
| 165 | + context "when include inactive storage locations checkbox is checked" do |
| 166 | + let(:inactive_storage_location) { |
| 167 | + create( |
| 168 | + :storage_location, |
| 169 | + name: "Inactive Storage Location", |
| 170 | + address: "123 Donation Site Way", |
| 171 | + warehouse_type: StorageLocation::WAREHOUSE_TYPES.first, |
| 172 | + discarded_at: 5.months.ago |
| 173 | + ) |
| 174 | + } |
| 175 | + |
| 176 | + before do |
| 177 | + TestInventory.create_inventory( |
| 178 | + inactive_storage_location.organization, { |
| 179 | + inactive_storage_location.id => { |
| 180 | + item1.id => 1, |
| 181 | + item2.id => 1, |
| 182 | + item3.id => 1 |
| 183 | + } |
| 184 | + } |
| 185 | + ) |
| 186 | + end |
| 187 | + |
| 188 | + it "generates csv with Storage Locations that are inactive" do |
| 189 | + get storage_locations_path(include_inactive_storage_locations: "1", format: response_format) |
| 190 | + |
| 191 | + csv = <<~CSV |
| 192 | + Name,Address,Square Footage,Warehouse Type,Total Inventory,A,B,C,D |
| 193 | + Inactive Storage Location,123 Donation Site Way,100,Residential space used,3,1,1,1,0 |
| 194 | + Storage Location with Duplicate Items,"1500 Remount Road, Front Royal, VA 22630",100,Residential space used,1,0,0,1,0 |
| 195 | + Storage Location with Items,123 Donation Site Way,100,Residential space used,3,1,1,1,0 |
| 196 | + Storage Location with Unique Items,Smithsonian Conservation Center new,100,Residential space used,5,0,0,0,5 |
| 197 | + Test Storage Location,123 Donation Site Way,100,Residential space used,0,0,0,0,0 |
| 198 | + Test Storage Location 1,123 Donation Site Way,100,Residential space used,0,0,0,0,0 |
| 199 | + CSV |
| 200 | + |
| 201 | + expect(response.body).to eq(csv) |
| 202 | + end |
| 203 | + end |
164 | 204 | end |
165 | 205 | end |
166 | 206 |
|
|
255 | 295 | end |
256 | 296 | end |
257 | 297 | end |
| 298 | + |
258 | 299 | describe "GET #show" do |
259 | 300 | let(:item) { create(:item, name: "Test Item") } |
260 | 301 | let(:item2) { create(:item, name: "Test Item2") } |
|
0 commit comments