Skip to content

Commit

Permalink
fix admin specs
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Sep 6, 2024
1 parent 149c4c4 commit 863bb80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def initialize(form)
def call
return broadcast(:invalid) if form.invalid?

create_share_token
broadcast(:ok)
new_token = create_share_token
broadcast(:ok, new_token)
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def call
return broadcast(:invalid) if form.invalid?

update_share_token
broadcast(:ok)
broadcast(:ok, token)
end

private
Expand Down
4 changes: 2 additions & 2 deletions decidim-admin/spec/forms/share_token_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module Decidim::Admin
it "validates presence of token" do
form.token = nil
expect(form).to be_invalid
expect(form.errors[:token]).to include("cannot be blank")
expect(form.errors[:token]).to include("can't be blank")
end

context "when automatic_token is set" do
Expand All @@ -60,7 +60,7 @@ module Decidim::Admin

it "validates presence of expires_at" do
expect(form).to be_invalid
expect(form.errors[:expires_at]).to include("cannot be blank")
expect(form.errors[:expires_at]).to include("can't be blank")
end

context "when no_expiration is set" do
Expand Down

0 comments on commit 863bb80

Please sign in to comment.