Sha256: f22cf66a0e15bf0e058a2e8f1501fc7937a17910f22eb9c9974286d7c504b646

Contents?: true

Size: 639 Bytes

Versions: 37

Compression:

Stored size: 639 Bytes

Contents

# -*- encoding : utf-8 -*-

module Decko
  # for use in REST API specs
  module RestSpecMethods
    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
    def self.describe_api &block
      RSpec.describe CardController, type: :controller do
        routes { Decko::Engine.routes }
        include Capybara::DSL
        include RestSpecMethods
        instance_eval(&block)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decko-0.18.1 lib/decko/rest_spec_helper.rb
decko-0.18.0 lib/decko/rest_spec_helper.rb
decko-0.17.0 lib/decko/rest_spec_helper.rb
decko-0.16.0 lib/decko/rest_spec_helper.rb
decko-0.15.6 lib/decko/rest_spec_helper.rb
decko-0.15.5 lib/decko/rest_spec_helper.rb
decko-0.15.4 lib/decko/rest_spec_helper.rb
decko-0.15.3 lib/decko/rest_spec_helper.rb
decko-0.15.2.pre1 lib/decko/rest_spec_helper.rb
decko-0.15.1.1 lib/decko/rest_spec_helper.rb
decko-0.15.1 lib/decko/rest_spec_helper.rb
decko-0.15.0 lib/decko/rest_spec_helper.rb
decko-0.14.2 lib/decko/rest_spec_helper.rb
decko-0.14.1 lib/decko/rest_spec_helper.rb
decko-0.14.0 lib/decko/rest_spec_helper.rb
decko-0.13.4 lib/decko/rest_spec_helper.rb
decko-0.13.3 lib/decko/rest_spec_helper.rb
decko-0.13.2 lib/decko/rest_spec_helper.rb
decko-0.13.1 lib/decko/rest_spec_helper.rb
decko-0.13.0 lib/decko/rest_spec_helper.rb