Skip to content

Commit

Permalink
fix assemblies spec
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Sep 5, 2024
1 parent 47a88f0 commit 149c4c4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create_share_token
token: form.token,
expires_at: form.expires_at,
token_for: form.token_for,
registered_only: form.registered_only,
organization: form.organization,
user: form.user
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def update_share_token
{
expires_at: form.expires_at,
token_for: form.token_for,
registered_only: form.registered_only,
organization: form.organization,
user: form.user
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.sr-only {
.sr-only{
width: 1px;
height: 1px;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def org_admin_action?
:assembly_member,
:space_private_user,
:export_space,
:assemblies_setting,
:share_tokens,
:import
].include?(permission_action.subject)
Expand Down
2 changes: 1 addition & 1 deletion decidim-assemblies/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ en:
components: Components
info: Info
moderations: Moderations
private_users: Private participants
private_users: Private users
see_assembly: See assembly
assemblies_types: Assemblies types
models:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
find_by_id("share_token_no_expiration_false").click
find_by_id("share_token_registered_only_true").click
click_on "Create"
expect(page).to have_content("cannot be blank", count: 2)
expect(page).to have_content("can't be blank", count: 2)

fill_in "share_token_token", with: " custom token "
fill_in "share_token_expires_at", with: 1.day.from_now, visible: :all
fill_in "share_token_expires_at", with: 1.day.from_now.strftime("%d/%m/%Y %H:%M"), visible: :all
click_on "Create"

expect(page).to have_content("Token created successfully")
Expand Down Expand Up @@ -94,6 +94,8 @@
end

it "can edit a share token" do
token_to_edit = find("tbody tr:first-child td:first-child").text.strip

within "tbody tr:first-child td:nth-child(3)" do
expect(page).to have_content("Yes")
end
Expand All @@ -105,17 +107,16 @@
find_by_id("share_token_no_expiration_false").click
find_by_id("share_token_registered_only_false").click
click_on "Update"
expect(page).to have_content("cannot be blank", count: 1)

fill_in "share_token_expires_at", with: 1.day.from_now, visible: :all
expect(page).to have_content("can't be blank", count: 1)

fill_in "share_token_expires_at", with: 1.day.from_now.strftime("%d/%m/%Y %H:%M"), visible: :all
click_on "Update"

expect(page).to have_content("Token updated successfully")
expect(page).to have_css("tbody tr", count: 3)
within "tbody tr:first-child td:nth-child(2)" do
within "tbody tr", text: token_to_edit do
expect(page).to have_content(1.day.from_now.strftime("%d/%m/%Y %H:%M"))
end
within "tbody tr:first-child td:nth-child(3)" do
expect(page).to have_content("No")
end
end
Expand Down

0 comments on commit 149c4c4

Please sign in to comment.