Module: Caffeinate::RSpec::Matchers
- Defined in:
- lib/caffeinate/rspec/matchers/subscribe_to_caffeinate_campaign.rb,
lib/caffeinate/rspec/matchers/be_subscribed_to_caffeinate_campaign.rb,
lib/caffeinate/rspec/matchers/end_caffeinate_campaign_subscription.rb,
lib/caffeinate/rspec/matchers/unsubscribe_from_caffeinate_campaign.rb
Defined Under Namespace
Classes: BeSubscribedToCaffeinateCampaign, EndCaffeinateCampaignSubscription, SubscribeToCaffeinateCampaign, UnsubscribeFromCaffeinateCampaign
Instance Method Summary collapse
-
#be_subscribed_to_caffeinate_campaign(expected_campaign) ⇒ BeSubscribedTo
Check if the subject subscribes to a given campaign.
-
#end_caffeinate_campaign_subscription(expected_campaign, subscriber, **args) ⇒ UnsubscribeFromCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in a ‘Caffeinate::CampaignSubscription` becoming `ended?`.
-
#subscribe_to_caffeinate_campaign(expected_campaign, subscriber, **args) ⇒ SubscribeToCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in a subscribe to a specified campaign.
-
#unsubscribe_from_caffeinate_campaign(expected_campaign, subscriber, **args) ⇒ UnsubscribeFromCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in an unsubscribe from a specified campaign.
Instance Method Details
#be_subscribed_to_caffeinate_campaign(expected_campaign) ⇒ BeSubscribedTo
Check if the subject subscribes to a given campaign. Only checks for presence.
This can be easily accessed via ‘UserOnboardingDripper.campaign`
10 11 12 |
# File 'lib/caffeinate/rspec/matchers/be_subscribed_to_caffeinate_campaign.rb', line 10 def be_subscribed_to_caffeinate_campaign(expected_campaign) BeSubscribedToCaffeinateCampaign.new(expected_campaign) end |
#end_caffeinate_campaign_subscription(expected_campaign, subscriber, **args) ⇒ UnsubscribeFromCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in a ‘Caffeinate::CampaignSubscription` becoming `ended?`.
12 13 14 |
# File 'lib/caffeinate/rspec/matchers/end_caffeinate_campaign_subscription.rb', line 12 def end_caffeinate_campaign_subscription(expected_campaign, subscriber, **args) EndCaffeinateCampaignSubscription.new(expected_campaign, subscriber, **args) end |
#subscribe_to_caffeinate_campaign(expected_campaign, subscriber, **args) ⇒ SubscribeToCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in a subscribe to a specified campaign.
12 13 14 |
# File 'lib/caffeinate/rspec/matchers/subscribe_to_caffeinate_campaign.rb', line 12 def subscribe_to_caffeinate_campaign(expected_campaign, subscriber, **args) SubscribeToCaffeinateCampaign.new(expected_campaign, subscriber, **args) end |
#unsubscribe_from_caffeinate_campaign(expected_campaign, subscriber, **args) ⇒ UnsubscribeFromCaffeinateCampaign
Creates an RSpec matcher for testing whether an action results in an unsubscribe from a specified campaign.
12 13 14 |
# File 'lib/caffeinate/rspec/matchers/unsubscribe_from_caffeinate_campaign.rb', line 12 def unsubscribe_from_caffeinate_campaign(expected_campaign, subscriber, **args) UnsubscribeFromCaffeinateCampaign.new(expected_campaign, subscriber, **args) end |