Paul Krugman frequently says that conservatives live in an "information bubble," and sometimes gives the belief that Mitt Romney would win as an example: "the polls clearly pointed to an Obama win but Republicans lived in a closed information loop where such information was excluded ..." He may be right on the general point, but I've never found the example to be convincing. First, even though election polls have a pretty good track record, there are sometimes systematic discrepancies. In 2012, the polls showed only a narrow lead for Obama, so it wasn't irrational to think that Mitt Romney was going to win. Second, it seems to be a general human tendency to think that things will turn out the way you want them to turn out.
I looked for questions of the general form "Regardless of how you plan to vote, who do you expect to win the **** presidential election, ***** or ****?" There was some variation in question wording, but it seemed to make little or no difference to the results. In recent elections, the question has been asked pretty frequently, so I used examples from within about ten days of the election (four or five per election). In earlier years, they were less common, so I used anything from the end of September on. In most cases, there were still only one or two, and a few were missing entirely. The figure shows the relationship between the proportion who expected the Democrat to win (out of the people who had an opinion) and the Democratic share of the two-party vote.
There's a strong relationship to the actual election results--for example, only 6% thought that George McGovern would win in 1972, but more than 80% expected Bill Clinton to win in 1990. There was no systematic difference in expectations about Democrats and Republicans, but there were a few cases in which expectations were substantially different from what you would expect given the actual votes. One was 1968, when only 25% expected Humphrey to beat Nixon, but the election was very close. That survey was taken at the end of September. I've heard that the election tightened up near the end, so if the question had been asked just before the election expectations might have been more evenly split. The other elections that stand out are 1952 and 1956, which both involved Adlai Stevenson vs. Dwight Eisenhower. In 1956, about 30% expected Stevenson to win. Eisenhower had won pretty easily in 1952 and been a popular president, so I'm surprised that anyone except a few die-hards thought Stevenson had a chance. For 1952, the only data available was from August, but at that point about 45% expected Stevenson to win.
My guess about the reason that 1952 and 1956 were different is that after 1948, when all the polls said that Dewey would beat Truman, people (especially Democrats) were more inclined to go with their gut. But maybe it was something about Stevenson or the political climate of the time. In any case, there's no sign that Republicans were particularly unrealistic in 2012.
Another interesting point is that in 1968, 6% expected George Wallace to win. In 1992, only 2% expected Ross Perot to win, even thought Perot got a considerably higher share of the vote than Wallace did (19% vs. 13%).