Note we're excluding a few files: * Configuration files that weren't generated by us * Migration files that weren't generated by us * The Gemfile, since it includes an important comment that must be on the same line as the gem declaration * The Budget::Stats class, since the heading statistics are a mess and having shorter lines would require a lot of refactoring
19 lines
765 B
Ruby
19 lines
765 B
Ruby
require "rails_helper"
|
|
|
|
describe Account::PermissionsListComponent do
|
|
it "adds different classes for actions that can and cannot be performed" do
|
|
render_inline Account::PermissionsListComponent.new(User.new)
|
|
|
|
expect(page).to have_css "li.permission-allowed", text: "Participate in debates"
|
|
expect(page).to have_css "li.permission-denied", text: "Support proposals"
|
|
end
|
|
|
|
it "adds a hint when an action cannot be performed" do
|
|
render_inline Account::PermissionsListComponent.new(User.new)
|
|
|
|
expect(page).to have_css "li", exact_text: "Additional verification needed Support proposals",
|
|
normalize_ws: true
|
|
expect(page).to have_css "li", exact_text: "Participate in debates", normalize_ws: true
|
|
end
|
|
end
|