Since the message might appear several times on the same page, it's useful to give a bit more context. Besides, usability tests show that when there's a group with no headings, there's no clear indication on the page that the group is actually a group and not a heading. We're also adding some emphasis to the group name in the "Showing headings" message, to be consistent with the emphasis we've added the the group name in the "No headings" message.
13 lines
447 B
Ruby
13 lines
447 B
Ruby
require "rails_helper"
|
|
|
|
describe Admin::BudgetHeadings::HeadingsComponent do
|
|
it "includes group name in the message when there are no headings" do
|
|
group = create(:budget_group, name: "Whole planet")
|
|
|
|
render_inline Admin::BudgetHeadings::HeadingsComponent.new(group.headings)
|
|
|
|
expect(page.text.strip).to eq "There are no headings in the Whole planet group."
|
|
expect(page).to have_css "strong", exact_text: "Whole planet"
|
|
end
|
|
end
|