       end
     end
 
+    @tag :phoenix_pubsub
+    test "when change notifications are enabled, delete(flag_name, gate) will publish a notification to PhoenixPubSub", %{name: name, group_gate: group_gate} do
+      assert Config.change_notifications_enabled?
+
+      u_id = NotifiPhoenix.unique_id()
+
+      with_mocks([
+        {Phoenix.PubSub, [:passthrough], []}
+      ]) do
+        assert {:ok, %Flag{name: ^name}} = PersiRedis.delete(name, group_gate)
+        :timer.sleep(10)
+
+        assert called(
+          Phoenix.PubSub.broadcast!(
+            :fwf_test,
+            "fun_with_flags_changes",
+            {:fwf_changes, {:updated, name, u_id}}
+          )
+        )
+      end
+    end
+
+
     @tag :redis_pubsub
     test "when change notifications are enabled, delete(flag_name, gate) will cause other subscribers to receive a Redis notification", %{name: name, group_gate: group_gate} do
       assert Config.change_notifications_enabled?

      end
    end

    @tag :redis_pubsub
    test "when change notifications are enabled, put() will cause other subscribers to receive a Redis notification", %{name: name, gate: gate, flag: flag} do
      assert Config.change_notifications_enabled?

          Redix.command(
            FunWithFlags.Store.Persistent.Redis,
            ["PUBLISH", "fun_with_flags_changes", "unique_id_foobar:#{name}"]
          )
        )
      end
    end

    @tag :phoenix_pubsub
    test "when change notifications are NOT enabled, delete(flag_name, gate) will NOT publish a notification to Phoenix.PubSub ", %{name: name, group_gate: group_gate} do
      u_id = NotifiPhoenix.unique_id()

      with_mocks([
        {Config, [], [change_notifications_enabled?: fn() -> false end]},
        {Phoenix.PubSub, [:passthrough], []}
      ]) do
        assert {:ok, %Flag{name: ^name}} = PersiRedis.delete(name, group_gate)
        :timer.sleep(10)

        refute called(
          Phoenix.PubSub.broadcast!(
            :fwf_test,
            "fun_with_flags_changes",
            {:fwf_changes, {:updated, name, u_id}}
          )
        )
      end
