FIX: error during signup saying "Password is the same as your current password" due to automatic group membership granting a trust level

This commit is contained in:
Neil Lalonde
2016-12-28 17:36:02 -05:00
parent 67347432b7
commit 9c40657ba4
3 changed files with 33 additions and 3 deletions

View File

@ -1175,6 +1175,17 @@ describe User do
expect(group_history.target_user).to eq(user)
end
it "get attributes from the group" do
group = Fabricate(:group, automatic_membership_email_domains: "bar.com|wat.com", grant_trust_level: 1, title: "bars and wats", primary_group: true)
user = Fabricate.build(:user, trust_level: 0, email: "foo@bar.com", password: "strongpassword4Uguys")
user.password_required!
expect(user.save).to eq(true)
user.reload
expect(user.title).to eq("bars and wats")
expect(user.trust_level).to eq(1)
expect(user.trust_level_locked).to eq(true)
end
end
describe "number_of_flags_given" do