   alias FunWithFlags.Store.Persistent.Redis, as: PersiRedis
   alias FunWithFlags.{Config, Flag, Gate}
   alias FunWithFlags.Notifications.Redis, as: NotifiRedis
+  alias FunWithFlags.Notifications.PhoenixPubSub, as: NotifiPhoenix
 
   @moduletag :redis_persistence
 

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

      end
    end

    @tag :phoenix_pubsub
    test "when change notifications are enabled, delete(flag_name) will publish a notification to Phoenix.PubSub", %{name: name} do
      assert Config.change_notifications_enabled?

      u_id = NotifiPhoenix.unique_id()

      with_mocks([
        {Phoenix.PubSub, [:passthrough], []}
      ]) do
        assert {:ok, %Flag{name: ^name, gates: []}} = PersiRedis.delete(name)
        :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) will cause other subscribers to receive a Redis notification", %{name: name} do
      assert Config.change_notifications_enabled?
