blob: 70a13bdb1add803ce9abf4cf2eecbb2321885244 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
Given /^I have published a "([^"]*)" key$/ do |type|
identity = Identity.for(@user)
keyring = Keyring.new(identity)
SecureRandom.stubs(urlsafe_base64: 'DUMMY_REV')
keyring.create type, 'DUMMY_KEY'
end
Given /^I have published "([^"]*)" keys$/ do |type|
identity = Identity.for(@user)
keyring = Keyring.new(identity)
SecureRandom.stubs(urlsafe_base64: 'DUMMY_REV')
keyring.create type, one: 'DUMMY_KEY', two: 'DUMMY_KEY'
end
Then /^I should have published an? "([^"]*)" key(?: with value "([^"]*)")?$/ do |type, value|
identity = Identity.for(@user)
keys = identity.keys
assert_includes keys.keys, type
assert_equal value, JSON.parse(keys[type])['value'] if value
end
|