Skip to content

Commit

Permalink
Remove EmailSubscription states from pact helper
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Sep 12, 2023
1 parent 9bddffb commit 14ab0c0
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions spec/service_consumers/pact_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ def stub_cached_attributes(email_verified: true)
email_verified:,
)
end

def stub_will_create_email_subscription(topic_slug, subscriber_list_id: "list-id")
stub_email_alert_api_has_subscriber_list_by_slug(
slug: topic_slug,
returned_attributes: { id: subscriber_list_id },
)

stub_email_alert_api_creates_a_subscription(
subscriber_list_id:,
address: EMAIL_ADDRESS,
frequency: "daily",
returned_subscription_id: "subscription-id",
skip_confirmation_email: true,
)
end
end

def oidc_user
Expand Down Expand Up @@ -125,21 +110,12 @@ def url_encode(str)
provider_state "there is a valid user session" do
set_up do
stub_cached_attributes
stub_will_create_email_subscription "wizard-news-topic-slug"
# rubocop:disable RSpec/AnyInstance
allow_any_instance_of(AccountSession).to receive(:set_remote_attributes)
# rubocop:enable RSpec/AnyInstance
end
end

provider_state "there is a valid user session, with a 'wizard-news' email subscription" do
set_up do
stub_cached_attributes
stub_will_create_email_subscription "wizard-news-topic-slug"
FactoryBot.create(:email_subscription, name: "wizard-news", oidc_user_id: oidc_user.id)
end
end

provider_state "there is a valid user session, with an attribute called 'email'" do
set_up do
stub_cached_attributes
Expand Down

0 comments on commit 14ab0c0

Please sign in to comment.