Created
June 3, 2013 16:47
-
-
Save anonymous/5699499 to your computer and use it in GitHub Desktop.
rspec stub/mock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ".ldap_authenticate" do | |
describe "for invalid credentials" do | |
before :each do | |
conn = double("LDAP::SSLConn") | |
LDAP::SSLConn.any_instance.stub(:new).and_return conn | |
conn.should_receive(:bind) | |
end | |
it "returns false" do | |
User.ldap_authenticate "test", "test" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment