The Founders debated and scrapped the religious test for office for good reason. That said, obama’s problem isn’t that he’s islamic, it’s that he wants to govern outside the Constitution.
This is no restriction upon reasons that any voter may have for voting the candidate in a primary or general election. This means such criteria to accept a candidate or officeholder can’t be required by an executive body or legislated. At that time, a “religious test” might mean criteria which approved the Anglican but not the Congregationalist, etc. A “Mussulman” would not have come into consideration.