Sha256: c2bcf46f254d637b6521a09446e3978a339dcd8b565dcd1f9d93b2951be8c46e
Contents?: true
Size: 821 Bytes
Versions: 15
Compression:
Stored size: 821 Bytes
Contents
# -*- coding: utf-8 -*- require 'spec_helper' class TestRequest < Mushikago::Http::GetRequest include Mushikago::Auth::Signature end describe Mushikago::Auth::Signature do before do @request = TestRequest.new @request.host = 'mushikago.org' @request.path = '/1/someapi.json' @request['api_key'] = 'api_key' @request['timestamp'] = '2011-09-01T00:00:00Z' end context 'generates string to sign' do subject{ @request.string_to_sign } it{ should == "GET\nmushikago.org\n/1/someapi.json\napi_key=api_key×tamp=2011-09-01T00%3A00%3A00Z" } end context 'add signature' do before do @request.add_signature!(Mushikago::Auth::Signer.new('secret_key')) end subject{ @request['signature'] } it{ should == 'sJSFFQREYbNPd2kJK3kuAR3uSgvcbuWtxGFjan+R3w8=' } end end
Version data entries
15 entries across 12 versions & 1 rubygems