Skip to content

Commit

Permalink
Resolve Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaryanpal committed Sep 14, 2024
1 parent 194f71d commit 81655f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/partner_groups_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class PartnerGroupsController < ApplicationController
before_action :set_partner_groups, only: %i[edit destroy]
before_action :set_partner_group, only: %i[edit destroy]

def new
@partner_group = current_organization.partner_groups.new
Expand Down Expand Up @@ -41,7 +41,7 @@ def destroy

private

def set_partner_groups
def set_partner_group
@partner_group = current_organization.partner_groups.find(params[:id])
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/partners/_partner_groups_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</td>
<td class="text-left">
<%= edit_button_to edit_partner_group_path(pg) %>
<%= delete_button_to(partner_group_path(pg),{confirm: confirm_delete_msg(pg.name)}) unless pg.partners.any? %>
<%= delete_button_to(partner_group_path(pg),{confirm: confirm_delete_msg(pg.name)}) if pg.partners.none? %>
</td>
</tr>
<% end %>
Expand Down
6 changes: 3 additions & 3 deletions spec/system/partner_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@
it 'should not display the delete link' do
visit partners_path
click_on 'Groups'
expect(page).to have_content(first_partner_group.name)
expect(page).to have_content(first_partner.name)
expect(page).to have_content('Group 2')
expect(page).to have_content('Leslie Sue, the 1')
expect(page).not_to have_link('Delete')
end
end
Expand All @@ -554,7 +554,7 @@
it 'should display the delete link and allow deletion' do
visit partners_path
click_on 'Groups'
expect(page).to have_content(second_partner_group.name)
expect(page).to have_content('Group 1')
expect(page).to have_link('Delete')
expect do
accept_confirm do
Expand Down

0 comments on commit 81655f3

Please sign in to comment.