Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/decorators/service_provider_session_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def legacy_logo_url
logo = sp_logo
ActionController::Base.helpers.image_path("sp-logos/#{logo}")
rescue Propshaft::MissingAssetError
nil
''
end

def new_session_heading
Expand Down
2 changes: 1 addition & 1 deletion spec/decorators/service_provider_session_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
service_provider_request: ServiceProviderRequestProxy.new,
)

expect(subject.sp_logo_url).is_a? String
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops that was not an assertion! glad we caught

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah 😬 I also did a regex search expect\(.+?\)\.is_a to find any others, looks like this is the only one.

expect(subject.sp_logo_url).to be_kind_of(String)
end
end
end
Expand Down
17 changes: 17 additions & 0 deletions spec/views/shared/_nav_branded.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,21 @@
expect(rendered).to have_css("img[alt*='No logo no problem']")
end
end

context 'service provider has a poorly configured logo' do
before do
sp = build_stubbed(:service_provider, logo: 'abc')
decorated_session = ServiceProviderSessionDecorator.new(
sp:,
view_context:,
sp_session: {},
service_provider_request: nil,
)
allow(view).to receive(:decorated_session).and_return(decorated_session)
end

it 'does not raise an exception' do
expect { render }.not_to raise_exception
end
end
end