Tidy the key spec and fix failing user spec
This commit is contained in:
parent
4768afbdbf
commit
b371d75128
2 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ describe Key, models: true do
|
|||
|
||||
describe "#publishable_keys" do
|
||||
it 'replaces SSH key comment with simple identifier of username + hostname' do
|
||||
expect(build(:key, user: user).publishable_key).to match(/#{Regexp.escape(user.name)} \(localhost\)/)
|
||||
expect(build(:key, user: user).publishable_key).to include("#{user.name} (localhost)")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -643,7 +643,7 @@ describe User, models: true do
|
|||
user = create :user
|
||||
key = create :key, key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD33bWLBxu48Sev9Fert1yzEO4WGcWglWF7K/AwblIUFselOt/QdOL9DSjpQGxLagO1s9wl53STIO8qGS4Ms0EJZyIXOEFMjFJ5xmjSy+S37By4sG7SsltQEHMxtbtFOaW5LV2wCrX+rUsRNqLMamZjgjcPO0/EgGCXIGMAYW4O7cwGZdXWYIhQ1Vwy+CsVMDdPkPgBXqK7nR/ey8KMs8ho5fMNgB5hBw/AL9fNGhRw3QTD6Q12Nkhl4VZES2EsZqlpNnJttnPdp847DUsT6yuLRlfiQfz5Cn9ysHFdXObMN5VYIiPFwHeYCZp1X2S4fDZooRE8uOLTfxWHPXwrhqSH", user_id: user.id
|
||||
|
||||
expect(user.all_ssh_keys).to include(key.key)
|
||||
expect(user.all_ssh_keys).to include(a_string_starting_with(key.key))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue