When the Senate approved a comprehensive immigration reform measure, Sens. Marco Rubio of Florida and Rand Paul of Kentucky voted in opposite directions amid divisions in the party over how to curb the fast-growing flow of Latino voters to Democrats.

At the same time, the Supreme Court rulings supporting gay marriage attracted broad criticism from most 2016 hopefuls, though Paul suggested that Republicans need to "agree to disagree on some of these issues." That foreshadows likely fissures ahead, as Republican contenders face increasing pressure to show more tolerance toward gay marriage with many Republican voters in their 20s, 30s and 40s calling for acceptance.

Taken together, the issues offer an early test for a Republican Party looking for a White House winner after back-to-back Democratic victories and seeking to transform itself amid rapidly changing public opinion toward acceptance on these and other cultural matters.

Republican strategists say both topics serve as gateway issues for many voters. If the party’s tone on immigration or gay marriage sounds too intolerant, they say, it could prevent voters from listening on other issues.

"If we want to win general elections we’re going to have to have a few people in the party who disagree on an issue or two," said Henry Barbour, a Republican National Committee member from Mississippi. "We can’t demand purity."

The twin issues spilled out into full view last week when the Senate approved an immigration reform bill and the Supreme Court struck down the Defense of Marriage Act, a federal law denying federal benefits to married gay couples, while clearing the way for the resumption of same-sex marriage in California.

Rubio, a chief architect of the immigration overhaul, was among only 14 Republicans who voted for the plan. Paul and Sen. Ted Cruz of Texas opposed the measure, citing problems with border security.

Elsewhere, Rep. Paul Ryan of Wisconsin, who served as Mitt Romney’s 2012 running mate, has spoken of the urgency to fix the immigration system and former Florida Gov. Jeb Bush has made immigration reform one of his central public policy causes.

Some prominent Republican governors, including Chris Christie of New Jersey, Scott Walker of Wisconsin and Bobby Jindal of Louisiana, have largely stayed on the sidelines of the debate.

While intense jockeying in early voting states will not begin in earnest until 2015, supporting immigration reform could be nettlesome in states like Iowa and South Carolina where some GOP activists have opposed citizenship or legalization for immigrants who have been living in the U.S. illegally. That said, Republicans nominated Arizona Sen. John McCain in 2008 even after he pushed for immigration reform, though it almost lost him the nomination.

The issue could have the biggest impact on Rubio, the son of Cuban immigrants who has drawn criticism in some conservative circles. Rubio defended himself, saying in a Senate floor speech that he wasn’t trying to build "support for future office" but to fix problems.

Rubio later told colleagues the U.S. can control who comes here but "unlike other countries, we are not afraid of people coming in from other places." In a nod to evangelicals, he referenced Psalm 78 in the Bible, which said, "God divided the sea and led them through."

Paul spoke favorably of immigration reform during the spring but registered his opposition before the vote, saying it failed to adequately secure the U.S.-Mexican border. Cruz, a tea party favorite, said the border security provision was nothing more than a "fig leaf" sought by both parties.

Former Pennsylvania Sen. Rick Santorum, who challenged Romney for the nomination last year, warned that Republicans like Rubio would suffer "consequences" for supporting the bill if they sought the presidency.

Sen. Jeff Chiesa, R-N.J., who was tapped by Christie to fill a Senate vacancy, voted for the plan. Christie has said his former legal adviser is his "own man" but Chiesa’s vote was viewed as a possible reflection of Christie’s outlook. The governor has called for tighter border controls and a pathway to citizenship for legal immigrants in the past and said those who are here illegally should "get to the back of the line." But he has avoided diving into the specifics of the legislation. During a radio interview last week, he said he had "enough to deal with here in New Jersey. I’m not interested in being a federal official."

On gay marriage, Republicans largely opposed the Supreme Court’s decisions, saying the rulings would lead to renewed efforts in the states to define marriage between a man and a woman.

Paul noted that the ruling kept intact nearly three dozen state laws against gay marriage but told ABC News that Republicans need to "agree to disagree on some of these issues." Rubio was more pessimistic, saying the Supreme Court made a "serious mistake" and overstepped its boundaries. Rubio also urged those who support the sanctity of marriage to be "respectful to the millions of American sons and daughters who are gay."

Bush didn’t immediately comment on the Supreme Court rulings but has said in the past that gay marriage should be decided by individual states. In a speech in June, Bush told the Faith and Freedom Coalition that "families don’t look all the time like they used to, and that’s OK," and said the nation needs to be supportive of non-traditional families.

Christie, in a radio interview, lambasted the decision, saying Justice Anthony Kennedy, who wrote the majority opinion, was "incredibly insulting" to members of Congress and President Bill Clinton, who helped pass the Defense of Marriage Act at the time. Christie vetoed a bill in 2012 that would let gay couples marry and said he would do it again if it reaches his desk.

Santorum said he found the rulings to be disappointing and called the DOMA decision "another case of the high court overstepping its role, just as it did with Roe v. Wade."

Walker and Jindal did not immediately comment on the ruling. Walker, the son of a Baptist minister, has supported Wisconsin’s constitutional ban on same-sex marriage, passed in 2006. As a Louisiana congressman, Jindal voted in favor of a joint resolution in 2006 to propose a constitutional amendment defining marriage as a union of a man and a woman.