From b657fb5d9118052427abc374d77186325d005fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Sat, 27 Jul 2024 13:51:52 +0200 Subject: [PATCH] fix specs --- .../spec/commands/decidim/admin/create_share_token_spec.rb | 5 +---- .../spec/commands/decidim/admin/update_share_token_spec.rb | 2 +- .../spec/system/preview_debates_with_share_token_spec.rb | 2 +- docs/modules/develop/pages/share_tokens.adoc | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/decidim-admin/spec/commands/decidim/admin/create_share_token_spec.rb b/decidim-admin/spec/commands/decidim/admin/create_share_token_spec.rb index c66fc4608bdb0..e95b995460b39 100644 --- a/decidim-admin/spec/commands/decidim/admin/create_share_token_spec.rb +++ b/decidim-admin/spec/commands/decidim/admin/create_share_token_spec.rb @@ -20,7 +20,7 @@ module Decidim::Admin ).with_context( current_user:, current_organization: organization, - component: + resource: component ) end @@ -29,7 +29,6 @@ module Decidim::Admin let(:automatic_token) { false } let(:no_expiration) { false } let(:registered_only) { true } - let(:form_invalid) { false } context "when the form is valid" do it "creates a share token" do @@ -51,8 +50,6 @@ module Decidim::Admin end context "when the form is invalid" do - let(:form_invalid) { true } - before do allow(form).to receive(:invalid?).and_return(true) end diff --git a/decidim-admin/spec/commands/decidim/admin/update_share_token_spec.rb b/decidim-admin/spec/commands/decidim/admin/update_share_token_spec.rb index ba84d986bbf6d..840da3f7dcb7e 100644 --- a/decidim-admin/spec/commands/decidim/admin/update_share_token_spec.rb +++ b/decidim-admin/spec/commands/decidim/admin/update_share_token_spec.rb @@ -21,7 +21,7 @@ module Decidim::Admin ).with_context( current_user: user, current_organization: organization, - component: + resource: component ) end diff --git a/decidim-debates/spec/system/preview_debates_with_share_token_spec.rb b/decidim-debates/spec/system/preview_debates_with_share_token_spec.rb index 01c8e63c83750..7e9c1ff8a1d63 100644 --- a/decidim-debates/spec/system/preview_debates_with_share_token_spec.rb +++ b/decidim-debates/spec/system/preview_debates_with_share_token_spec.rb @@ -6,5 +6,5 @@ let(:manifest_name) { "debates" } include_context "with a component" - it_behaves_like "preview component with a hare_token" + it_behaves_like "preview component with a share_token" end diff --git a/docs/modules/develop/pages/share_tokens.adoc b/docs/modules/develop/pages/share_tokens.adoc index fd46b3b5bc9b8..09b20ceaefa80 100644 --- a/docs/modules/develop/pages/share_tokens.adoc +++ b/docs/modules/develop/pages/share_tokens.adoc @@ -31,7 +31,7 @@ return unless token.present? allow! if Decidim::ShareToken.use!(token_for: your_resource, token: token) ---- -Note that, if you are using a controller who is inheriting from `Decidim::ApplicationController`, you don't need to include the `:share_token` in the context when calling methods like `enforce_permission_to`, as it is already included in the `Decidim::NeedsPermissions` class through the method `store_share_token`. +Note that, if you are using a controller who is inheriting from `Decidim::ApplicationController`, you do not need to include the `:share_token` in the context when calling methods like `enforce_permission_to`, as it is already included in the `Decidim::NeedsPermissions` class through the method `store_share_token`. == Manage tokens