Skip to content

Commit

Permalink
Merge pull request #71 from friendlycart/null-promotion-handler
Browse files Browse the repository at this point in the history
Add a null promotion handler
  • Loading branch information
mamhoff authored Nov 7, 2023
2 parents 3f6ba08 + 234f73e commit b9e22c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module SolidusFriendlyPromotions
module PromotionHandler
# We handle shipping promotions just like other promotions, so we don't need a
# special promotion handler for shipping. However, Solidus wants us to implement one.
# This is what this class is for.
class Null
attr_reader :order
attr_accessor :error, :success

def initialize(order)
@order = order
end

def activate
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe SolidusFriendlyPromotions::PromotionHandler::Null do
let(:order) { double }

subject { described_class.new(order) }

it { is_expected.to respond_to(:order) }
it { is_expected.to respond_to(:error) }
it { is_expected.to respond_to(:success) }
it { is_expected.to respond_to(:activate) }
end

0 comments on commit b9e22c0

Please sign in to comment.