Skip to content

Commit

Permalink
add test case to system spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Apr 22, 2024
1 parent 1218707 commit 0a1bd0a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/system/admin/token_codes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,25 @@

expect(page).to have_content("Access code token successfully destroyed")
end

it "allows sorting columns" do
click_link "Generate new codes"

fill_in "Number of tokens to generate", with: 15

perform_enqueued_jobs do
click_on "Generate Tokens"
end

within("thead tr") do
expect(page).to have_css("th:nth-child(1)", text: "Token")
expect(page).to have_css("th:nth-child(2)", text: "Available?")
expect(page).to have_css("th:nth-child(3)", text: "Used?")
expect(page).to have_css("th:nth-child(4)", text: "Num. of uses")
end

click_on "Token"
token_column = all(".table-list tbody tr td:first-child").map(&:text)
expect(token_column).to eq(token_column.sort)
end
end

0 comments on commit 0a1bd0a

Please sign in to comment.