The big air raids in Coventry are believed to be an example for this.
The british knew in advance of it, because of Enigma, but did not made special preparations, to keep the bigger advantage.
I learned this as a fact, but upon checking now, it likely has been a rumor/conspiracy.
But there surely are other, real examples.
Yes, the movie emphasized this in a rather dramatic way, to make sure everyone got it.
They would also send out patrol planes to detect U-boats so the Germans would think that's how the destroyers found where they were.