Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Jul 27, 2024
1 parent 6b1dddb commit b657fb5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Decidim::Admin
).with_context(
current_user:,
current_organization: organization,
component:
resource: component
)
end

Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Decidim::Admin
).with_context(
current_user: user,
current_organization: organization,
component:
resource: component
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/modules/develop/pages/share_tokens.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b657fb5

Please sign in to comment.