From 644b8bb2fe5fcccc0120e8de97a1da7d2b505533 Mon Sep 17 00:00:00 2001 From: laserlemon Date: Wed, 13 Oct 2010 09:44:39 -0400 Subject: [PATCH] Add PLAINTEXT signature test. --- test/simple_oauth_test.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/simple_oauth_test.rb b/test/simple_oauth_test.rb index 7d43ec3..8374736 100644 --- a/test/simple_oauth_test.rb +++ b/test/simple_oauth_test.rb @@ -266,6 +266,19 @@ class SimpleOAuthTest < Test::Unit::TestCase end def plaintext_signature - # Pending + # Sample request taken from: + # http://oauth.googlecode.com/svn/code/javascript/example/signature.html + options = { + :consumer_key => 'abcd', + :consumer_secret => 'efgh', + :nonce => 'oLKtec51GQy', + :signature_method => 'PLAINTEXT', + :timestamp => '1286977095', + :token => 'ijkl', + :token_secret => 'mnop' + } + successful = 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"' + header = SimpleOAuth::Header.new(:get, 'http://host.net/resource?name=value', {:name => 'value'}, options) + assert_equal successful, header.to_s end end