66e8857c20
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
842 B
Ruby
33 lines
842 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminSubscriptionSubscription < PageObjects::Pages::Base
|
|
SUBSCRIPTIONS_TABLE_SELECTOR = "table.discourse-patrons-table"
|
|
|
|
def visit_subscriptions
|
|
visit("/admin/plugins/discourse-subscriptions/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
|