FEATURE: can take over a staged account

This commit is contained in:
Régis Hanol
2015-11-13 19:07:28 +01:00
parent a682ec9444
commit 43614439e6
2 changed files with 17 additions and 1 deletions

View File

@ -746,6 +746,17 @@ describe UsersController do
end
end
context "when taking over a staged account" do
let!(:staged) { Fabricate(:staged, email: "staged@account.com") }
it "succeeds" do
xhr :post, :create, email: staged.email, username: "zogstrip", password: "P4ssw0rd"
result = ::JSON.parse(response.body)
expect(result["success"]).to eq(true)
expect(User.find_by(email: staged.email).staged).to eq(false)
end
end
end
context '.username' do