mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-03-09 13:42:17 +00:00
Instead of deleting customers on cancel we will now update the subscription status to canceled. This way we can have some visibility on which users have canceled.
33 lines
820 B
Ruby
33 lines
820 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class UserBillingSubscription < PageObjects::Pages::Base
|
|
SUBSCRIPTIONS_TABLE_SELECTOR = "table.discourse-subscriptions-user-table"
|
|
|
|
def visit_subscriptions
|
|
visit("/my/billing/subscriptions")
|
|
self
|
|
end
|
|
|
|
def has_subscription?(id)
|
|
has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
|
|
self
|
|
end
|
|
|
|
def subscription_row(id)
|
|
find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
|
|
end
|
|
|
|
def has_number_of_subscriptions?(count)
|
|
has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", count:)
|
|
self
|
|
end
|
|
|
|
def click_cancel_nth_row(row)
|
|
find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr:nth-child(#{row}) button.btn-danger").click()
|
|
end
|
|
end
|
|
end
|
|
end
|