Repository: decidim/decidim (Ruby)

Issue:
Liking a resource prompts for groups even though groups are disabled
### Describe the bug

When i visit any resource, and click "Like", the select identity is being triggered if i have a group associated to me, even though the groups are disabled at organization level.

### To Reproduce

1. Go to admin panel -> Configuration
2. Uncheck "Enable groups" and save 
3. Visit any resource ( like a blog post ) 
4. Click "Like"
5. See the identities pop-up

### Expected behavior

If the organization has the user group disabled, i should not see the identities pop-up. 

### Screenshots

_No response_

### Stacktrace

_No response_

### Extra data

- Decidim Version: 0.30.0
- Decidim installation: Dev / nightly 


### Additional context

_No response_



Fix (patch):
diff --git a/decidim-blogs/spec/system/endorse_posts_spec.rb b/decidim-blogs/spec/system/endorse_posts_spec.rb
index 2f76f2596dce8..cac8b4b67d060 100644
--- a/decidim-blogs/spec/system/endorse_posts_spec.rb
+++ b/decidim-blogs/spec/system/endorse_posts_spec.rb
@@ -6,99 +6,16 @@
   include_context "with a component"
   let(:manifest_name) { "blogs" }
   let(:organization) { create(:organization) }
-  let(:author) { create(:user, :confirmed, name: "Tester", organization:) }
-  let!(:post) { create(:post, component:, title: { en: "Blog post title" }) }
-
-  before do
-    sign_in author
-  end
-
-  context "when liking the post without belonging to a user group" do
-    it "likes the post" do
-      visit_component
-      click_on "Blog post title"
-      click_on "Like"
-
-      expect(page).to have_content("Dislike")
-    end
+  let!(:post) { create(:post, author: user, component:, title: { en: "Blog post title" }) }
+  let!(:resource) { post }
+  let!(:resource_name) { translated(post.title) }
+
+  let!(:component) do
+    create(:post_component,
+           *component_traits,
+           manifest:,
+           participatory_space:)
   end
 
-  context "when liking the post while being a part of a group" do
-    let!(:user_group) do
-      create(
-        :user_group,
-        :verified,
-        name: "Tester's Organization",
-        nickname: "test_org",
-        email: "t.mail.org@example.org",
-        users: [author],
-        organization:
-      )
-    end
-
-    before do
-      visit_component
-      click_on "Blog post title"
-    end
-
-    it "opens a modal where you select identity as a user or a group" do
-      click_on "Like"
-      expect(page).to have_content("Select identity")
-      expect(page).to have_content("Tester's Organization")
-      expect(page).to have_content("Tester")
-    end
-
-    def add_likes
-      click_on "Like"
-      click_on "Tester's Organization"
-      click_on "Tester"
-      click_on "Done"
-      visit current_path
-      click_on "Dislike"
-    end
-
-    context "when both identities picked" do
-      it "likes the post as a group and a user" do
-        add_likes
-
-        within ".identities-modal__list" do
-          expect(page).to have_css(".is-selected", count: 2)
-        end
-      end
-    end
-
-    context "when like cancelled as a user" do
-      it "does not cancel group like" do
-        add_likes
-        find(".is-selected", match: :first).click
-        click_on "Done"
-        visit current_path
-        click_on "Like"
-
-        within ".identities-modal__list" do
-          expect(page).to have_css(".is-selected", count: 1)
-          within ".is-selected" do
-            expect(page).to have_content("Tester's Organization")
-          end
-        end
-      end
-    end
-
-    context "when like cancelled as a group" do
-      it "does not cancel user like" do
-        add_likes
-        page.all(".is-selected")[1].click
-        click_on "Done"
-        visit current_path
-        click_on "Dislike"
-
-        within ".identities-modal__list" do
-          expect(page).to have_css(".is-selected", count: 1)
-          within ".is-selected" do
-            expect(page).to have_text("Tester", exact: true)
-          end
-        end
-      end
-    end
-  end
+  it_behaves_like "Endorse resource system specs"
 end
diff --git a/decidim-core/app/cells/decidim/endorsement_buttons_cell.rb b/decidim-core/app/cells/decidim/endorsement_buttons_cell.rb
index 0950bd8a4b8f1..61e1544cf5a1a 100644
--- a/decidim-core/app/cells/decidim/endorsement_buttons_cell.rb
+++ b/decidim-core/app/cells/decidim/endorsement_buttons_cell.rb
@@ -69,7 +69,7 @@ def endorse_allowed?
     end
 
     def user_has_verified_groups?
-      current_user && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any?
+      current_user && current_organization.user_groups_enabled? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any?
     end
 
     def endorse_translated