Skip to content

Commit f818231

Browse files
committed
Remove param organization_name where it's not needed
Remnant from #4331
1 parent d2014fd commit f818231

File tree

6 files changed

+5
-32
lines changed

6 files changed

+5
-32
lines changed

app/views/partners/_statuses.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
partner_count = status_counts[status] || 0 %>
1212
<li>
1313
<%= fa_icon icon_mapping[status] || '', class: "bg-partner-#{status} " %>
14-
<%= link_to_unless partner_count.zero?, "#{partner_count} #{status.humanize}", partners_path(organization_name:nil, filters: { by_status: status }), class: ("filtering" if status == current_filtered_status) %>
14+
<%= link_to_unless partner_count.zero?, "#{partner_count} #{status.humanize}", partners_path(filters: { by_status: status }), class: ("filtering" if status == current_filtered_status) %>
1515
</li>
1616
<% end %>
1717
<li>

spec/controllers/distributions_controller_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
context "when distribution causes inventory to remain above minimum quantity for an organization" do
2222
let(:params) do
2323
{
24-
organization_name: organization.id,
2524
distribution: {
2625
partner_id: partner.id,
2726
issued_at: Date.yesterday,
@@ -45,7 +44,6 @@
4544
context "when distribution causes inventory to fall below minimum quantity for a storage location" do
4645
let(:params) do
4746
{
48-
organization_name: organization.id,
4947
distribution: {
5048
partner_id: partner.id,
5149
storage_location_id: second_storage_location.id,
@@ -70,7 +68,6 @@
7068
let(:storage_location) { create(:storage_location, :with_items, item: first_item, item_quantity: 20, organization: organization) }
7169
let(:params) do
7270
{
73-
organization_name: organization.id,
7471
distribution: {
7572
partner_id: partner.id,
7673
storage_location_id: storage_location.id,
@@ -96,7 +93,6 @@
9693
let(:storage_location) { create(:storage_location, organization: organization) }
9794
let(:params) do
9895
{
99-
organization_name: organization.id,
10096
distribution: {
10197
partner_id: partner.id,
10298
storage_location_id: storage_location.id,
@@ -140,7 +136,6 @@
140136
end
141137
let(:params) do
142138
{
143-
organization_name: organization.id,
144139
distribution: {
145140
partner_id: partner.id,
146141
storage_location_id: storage_location.id,
@@ -179,7 +174,6 @@
179174
end
180175
let(:params) do
181176
{
182-
organization_name: organization.id,
183177
distribution: {
184178
partner_id: partner.id,
185179
storage_location_id: storage_location.id,
@@ -207,7 +201,6 @@
207201
let(:storage_location) { create(:storage_location, :with_items, item: item, item_quantity: 2, organization: organization) }
208202
let(:params) do
209203
{
210-
organization_name: organization.id,
211204
distribution: {
212205
partner_id: partner.id,
213206
storage_location_id: storage_location.id,
@@ -230,7 +223,6 @@
230223
context "when distribution reminder email is enabled" do
231224
let(:params) do
232225
{
233-
organization_name: organization.id,
234226
distribution: {
235227
partner_id: partner.id,
236228
issued_at: Date.tomorrow,
@@ -288,7 +280,6 @@
288280
let(:distribution) { create(:distribution, storage_location: storage_location) }
289281
let(:params) do
290282
{
291-
organization_name: organization.id,
292283
id: distribution.id,
293284
distribution: {
294285
storage_location_id: distribution.storage_location.id,
@@ -326,7 +317,6 @@
326317
let(:distribution) { create(:distribution, storage_location: storage_location, organization: organization) }
327318
let(:params) do
328319
{
329-
organization_name: organization.id,
330320
id: distribution.id,
331321
distribution: {
332322
storage_location_id: distribution.storage_location.id,
@@ -363,7 +353,6 @@
363353
let(:distribution) { create(:distribution, :with_items, item: item1, storage_location: storage_location, organization: organization) }
364354
let(:params) do
365355
{
366-
organization_name: organization.id,
367356
id: distribution.id,
368357
distribution: {
369358
storage_location_id: distribution.storage_location.id,
@@ -410,7 +399,6 @@
410399
let(:distribution) { create(:distribution, :with_items, item: item1, storage_location: storage_location, organization: organization, reminder_email_enabled: false, partner: partner) }
411400
let(:params) do
412401
{
413-
organization_name: organization.id,
414402
id: distribution.id,
415403
distribution: {
416404
storage_location_id: distribution.storage_location.id,

spec/controllers/help_controller_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
let(:organization) { create(:organization) }
33
let(:user) { create(:user, organization: organization) }
44

5-
let(:default_params) do
6-
{ organization_name: organization.to_param }
7-
end
8-
95
context "While signed in as a normal user >" do
106
before do
117
sign_in(user)
128
end
139

1410
describe "GET #show" do
15-
subject { get :show, params: default_params }
11+
subject { get :show }
1612
it "returns http success" do
1713
expect(subject).to be_successful
1814
end

spec/requests/admin/organizations_requests_spec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
RSpec.describe "Admin::Organizations", type: :request do
22
let(:organization) { create(:organization) }
3-
let(:default_params) do
4-
{ organization_name: organization.id }
5-
end
63

74
context "When logged in as a super admin" do
85
before do
@@ -110,7 +107,7 @@
110107
describe "PATCH #update" do
111108
let(:organization) { create(:organization, name: "Original Name") }
112109
subject do
113-
patch admin_organization_path(default_params.merge(id: organization.id, organization: { name: updated_name }))
110+
patch admin_organization_path(id: organization.id, organization: { name: updated_name })
114111
end
115112

116113
context "with a valid update" do
@@ -128,7 +125,7 @@
128125
let(:successful) { 200 }
129126

130127
subject do
131-
patch admin_organization_path(default_params.merge(id: organization.id, organization: { name: updated_name }))
128+
patch admin_organization_path(id: organization.id, organization: { name: updated_name })
132129
end
133130

134131
it "returns http success" do

spec/requests/dashboard_requests_spec.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
expect(response.body).to include('switch_to_role')
2727
end
2828
end
29-
30-
context "for another org" do
31-
it "still displays the user's org" do
32-
# another org
33-
get dashboard_path(organization_name: create(:organization).to_param)
34-
expect(response.body).to include(organization.name)
35-
end
36-
end
3729
end
3830

3931
context "BroadcastAnnouncement card" do

spec/requests/storage_locations_requests_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
file = fixture_file_upload("inventory.csv", "text/csv")
289289

290290
params = { file: file, storage_location: storage_location_with_items.id }
291-
post import_inventory_storage_locations_path(organization_name: organization.to_param), params: params
291+
post import_inventory_storage_locations_path, params: params
292292

293293
expect(response).to be_redirect
294294
expect(response).to have_error "Could not complete action: inventory already has items stored"

0 commit comments

Comments
 (0)