lib/decko/rest_spec_helper.rb in decko-0.8.3 vs lib/decko/rest_spec_helper.rb in decko-0.9.0
- old
+ new
@@ -1,11 +1,14 @@
# -*- encoding : utf-8 -*-
module Decko
# for use in REST API specs
module RestSpecMethods
- def with_token_for usermark
- yield Card[usermark].account.reset_token
+ def with_api_key_for usermark
+ key_card = Card.fetch [usermark, :account, :api_key], new: {}
+ key_card.content = "asdkfjh1023498203jdfs"
+ Card::Auth.as_bot { key_card.save! }
+ yield key_card.content
end
end
# for use in REST API specs
module RestSpecHelper