From 0de1552e53b683644edadb8c117ce55a0ff8482d Mon Sep 17 00:00:00 2001 From: Gary Tou Date: Thu, 10 Aug 2023 12:57:01 -0700 Subject: [PATCH 1/5] Add some very mediocre tests --- test/system/hackathon/subscriptions_test.rb | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/system/hackathon/subscriptions_test.rb diff --git a/test/system/hackathon/subscriptions_test.rb b/test/system/hackathon/subscriptions_test.rb new file mode 100644 index 00000000..6e2b1988 --- /dev/null +++ b/test/system/hackathon/subscriptions_test.rb @@ -0,0 +1,38 @@ +require "application_system_test_case" + +class Hackathon::SubscriptionsTest < ApplicationSystemTestCase + setup do + seattle = { + "city" => "Seattle", + "state" => "Washington", + "country_code" => "us", + "coordinates" => [47.6038321, -122.330062] + } + Geocoder::Lookup::Test.add_stub("Seattle, Washington, US", [seattle]) + Geocoder::Lookup::Test.add_stub(seattle["coordinates"], [seattle.except("coordinates")]) + + @subscriber = users(:gary) + @subscription = Hackathon::Subscription.find_or_create_by!( + subscriber: @subscriber, + city: "Seattle", + province: "Washington", + country_code: "US", + status: :active + ) + end + + test "managing subscriptions" do + visit Hackathon::Subscription.manage_subscriptions_url_for @subscriber + assert_selector "h1", text: "Manage Subscriptions" + end + + test "invalid manage subscriptions link" do + visit user_subscriptions_url @subscriber + assert_text "expired" + end + + test "unsubscribe all" do + visit Hackathon::Subscription.unsubscribe_all_url_for @subscriber + assert_empty @subscriber.subscriptions.active + end +end From d0214848a8dbe4de8f4857af229bb892c0c4fd27 Mon Sep 17 00:00:00 2001 From: Matt Almeida Date: Mon, 14 Aug 2023 14:55:12 -0400 Subject: [PATCH 2/5] Create workflow to reproduce Actions bug --- .github/workflows/ping-localhost.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/ping-localhost.yml diff --git a/.github/workflows/ping-localhost.yml b/.github/workflows/ping-localhost.yml new file mode 100644 index 00000000..30de4b65 --- /dev/null +++ b/.github/workflows/ping-localhost.yml @@ -0,0 +1,15 @@ +name: Ping localhost +on: [ push ] +jobs: + ping-localhost: + name: Ping localhost + runs-on: ubuntu-latest + steps: + - name: ping localhost + run: ping localhost + ping-127_0_0_1: + name: Ping 127.0.0.1 + runs-on: ubuntu-latest + steps: + - name: ping 127.0.0.1 + run: ping 127.0.0.1 From ca07a2dfe130c9369890a8397ca1a51ef4ee6fb1 Mon Sep 17 00:00:00 2001 From: Matt Almeida Date: Mon, 14 Aug 2023 15:15:58 -0400 Subject: [PATCH 3/5] Wipe GHA See if that works... --- .github/workflows/clear-gha.yml | 6 ++++++ .github/workflows/ping-localhost.yml | 15 --------------- 2 files changed, 6 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/clear-gha.yml delete mode 100644 .github/workflows/ping-localhost.yml diff --git a/.github/workflows/clear-gha.yml b/.github/workflows/clear-gha.yml new file mode 100644 index 00000000..456a37bb --- /dev/null +++ b/.github/workflows/clear-gha.yml @@ -0,0 +1,6 @@ +name: Wipe GHA +on: [ push ] +jobs: + wipe-gha: + name: Wipe Github Actions cache + uses: easimon/wipe-cache@v2 diff --git a/.github/workflows/ping-localhost.yml b/.github/workflows/ping-localhost.yml deleted file mode 100644 index 30de4b65..00000000 --- a/.github/workflows/ping-localhost.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Ping localhost -on: [ push ] -jobs: - ping-localhost: - name: Ping localhost - runs-on: ubuntu-latest - steps: - - name: ping localhost - run: ping localhost - ping-127_0_0_1: - name: Ping 127.0.0.1 - runs-on: ubuntu-latest - steps: - - name: ping 127.0.0.1 - run: ping 127.0.0.1 From 168d18de6a44bbf163e6698604343b3a41c845b4 Mon Sep 17 00:00:00 2001 From: Matt Almeida Date: Mon, 14 Aug 2023 15:26:08 -0400 Subject: [PATCH 4/5] fr --- .github/workflows/clear-gha.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clear-gha.yml b/.github/workflows/clear-gha.yml index 456a37bb..0df77988 100644 --- a/.github/workflows/clear-gha.yml +++ b/.github/workflows/clear-gha.yml @@ -3,4 +3,6 @@ on: [ push ] jobs: wipe-gha: name: Wipe Github Actions cache - uses: easimon/wipe-cache@v2 + runs-on: ubuntu-latest + steps: + - uses: easimon/wipe-cache@v2 From 3539a354ed175a8b3534dd44f3e7412c1244936a Mon Sep 17 00:00:00 2001 From: Matt Almeida Date: Mon, 14 Aug 2023 15:56:55 -0400 Subject: [PATCH 5/5] Wipe GHA cache wiper --- .github/workflows/clear-gha.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .github/workflows/clear-gha.yml diff --git a/.github/workflows/clear-gha.yml b/.github/workflows/clear-gha.yml deleted file mode 100644 index 0df77988..00000000 --- a/.github/workflows/clear-gha.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Wipe GHA -on: [ push ] -jobs: - wipe-gha: - name: Wipe Github Actions cache - runs-on: ubuntu-latest - steps: - - uses: easimon/wipe-cache@v2