-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
# | ||
# Copyright (c) 2023, Schweizer Alpen-Club. This file is part of | ||
# hitobito_sac_cas and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito | ||
|
||
require 'spec_helper' | ||
|
||
describe RoleDecorator, :draper_with_helpers do | ||
let(:role) { roles(:top_leader) } | ||
|
||
let(:decorator) { described_class.new(role) } | ||
|
||
describe '#for_aside' do | ||
subject(:node) { Capybara::Node::Simple.new(decorator.for_aside) } | ||
|
||
it 'wraps role#to_s in strong tag' do | ||
expect(node).to have_css('strong', text: role.to_s) | ||
end | ||
|
||
it 'prepends exclamatione mark if role is outdated' do | ||
role.delete_on = Time.zone.yesterday | ||
expect(node).to have_css('i.fa.fa-exclamation-triangle') | ||
expect(node).to have_css('strong', text: role.to_s) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters