Commit 52c1c7e8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

We shouldn't delete existing user, otherwise

it's not going to find the user, of course, right?

The `user` is already created in the other example,
unfortunately. If we `User.delete_all`, then `user`
would be pointing to a deleted user.
parent 88612187
...@@ -203,10 +203,9 @@ describe API::Users do ...@@ -203,10 +203,9 @@ describe API::Users do
context "when authenticated and ldap is enabled" do context "when authenticated and ldap is enabled" do
it "returns non-ldap user" do it "returns non-ldap user" do
User.delete_all
create :omniauth_user, provider: "ldapserver1" create :omniauth_user, provider: "ldapserver1"
get api("/users", user), skip_ldap: "true" get api("/users", user), skip_ldap: "true"
expect(response.status).to eq 200 expect(response).to have_gitlab_http_status(200)
expect(json_response).to be_an Array expect(json_response).to be_an Array
username = user.username username = user.username
expect(json_response.first["username"]).to eq username expect(json_response.first["username"]).to eq username
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment