I thought the should matchers were an add-on? Assuming you're comfortable monkey-patching Object to get them; are you sure you want to use should-style in the first place? RSpec moved away from it for a reason.
–
Dave NewtonApr 24 '14 at 14:47

@DaveNewton I'm using the gem shoulda-matchers and it works great. I just don't know how to change the context for a single test where an attribute changes. I added an extra line to my question to explain this.
–
Jumbalaya WantonApr 24 '14 at 14:48

2 Answers
2

I found that the better way to do this is to revert to good old MiniTest:

test "uniqueness of email with a different provider" do
email_user = create(:user, email: "foo@bar.com")
facebook_user = build_stubbed(:facebook_user, email: "foo@bar.com")
assert facebook_user.valid?, "should be valid with same email if provider is different"
end