One study states that rats "appear capable of reflecting on what they do and don't know". This type of thinking is known as metacognition - it is a "complex" form of cognition.
It has been found in primates but has not been extensively explored in other mammals.
The following describes the test that rats were given the choice to do to determine their metacognition abilities:
"If they bailed out of the test by poking their noses into one hole, they received a small reward of food pellets. If they opted in by nudging their snouts into another hole, passing the test resulted in a large reward of pellets, while failure yielded nothing.
The test played the rats noises that were either short (between 2 and 3.6 seconds) or long (between 4.4 and 8 seconds). The rodents then had to classify the recent noise as either long or short by pressing one of two levers. This choice was relatively easy if the noise was either very short or very long—for instance, 2 seconds or 8 seconds. However, the decision was far harder if the noise was easily confused as either short or long—for instance, 4.4 seconds."
It appeared that the rats were able to judge if they had enough knowledge to pass the test.
This means that on some level rats have similar knowledge reflection abilities to humans and primates.
Another study looked at if rats feel empathy - the understanding of anothers feelings. The test the untrained rats took part in let the rats have the option of freeing a restrained cage mate or eating chocolate. One researcher stated that “It said to us that essentially helping their cage mate is on a par with chocolate. He can hog the entire chocolate stash if he wanted to, and he does not. We were shocked.”
Another researcher said that “These rats are learning because they are motivated by something internal. We’re not showing them how to open the door, they don’t get any previous exposure on opening the door, and it’s hard to open the door. But they keep trying and trying, and it eventually works.”
These tests make me think that rats are smarter than we give them credit for. They show that rats are capable of complex cognition and empathy for other rats. Rats can also be trained, not unlike dogs, to complete small tasks for a reward. The public think of rats as pests, and indeed they can be in the wild, but they should also be made aware that rats are intelligent animals who can be great pets and have the capacity for relatively complex thought processes.