-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use configurable adjustment promotion source types in Thumbnail.for
There's a View Component for rendering icons, and it's got a convenience method for rendering adjustables to adjustments. This uses the `Spree::Config.adjustment_promotion_source_types` configuration option to figure out whether an adjustable needs a megaphone as an icon. With the legacy promotion system extracted, `Spree::Promotion` will not necessarily be available.
- Loading branch information
Showing
5 changed files
with
24 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
legacy_promotions/spec/components/solidus_admin/ui/thumbnail/component_spec.rb
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,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe SolidusAdmin::UI::Thumbnail::Component, type: :component do | ||
describe ".for" do | ||
let(:promotion_action) { Spree::PromotionAction.new } | ||
|
||
subject { render_inline described_class.for(promotion_action) } | ||
|
||
it "displays a megaphone" do | ||
subject | ||
expect(page).to have_xpath("//use[contains(@*, '#ri-megaphone')]") | ||
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