You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can make a request via rails console fine, so I know the app has been implemented correctly. When using the provided helper methods to sign the simple get request in the controller spec, the request does not appear to be signed correctly. Am I doing something wrong?
The successful console call:
coneybeare $ railsctestLoadingtestenvironment(Rails3.2.0)railstest: main
>> consumer=OAuth::Consumer.new("one_key","MyString",:site=>[REDACTED])# => #<OAuth::Consumer:0x007f9d01252268 @key="one_key", @secret="MyString", @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authorize", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0", :site=>[REDACTED]}> ruby: main
>> req=consumer.create_signed_request(:get,"/api/v1/users.json",nil)# => #<Net::HTTP::Get GET> ruby: main
>> res=Net::HTTP.start([REDACTED]){|http| http.request(req)}# => #<Net::HTTPOK 200 OK readbody=true> ruby: main
>> putsres.body{"users":[{"id":206669143},{"id":358143215}]}# => nil
The failed controller test:
it"responds as success with a valid oath signature"doconsumer=OAuth::Consumer.new("one_key","MyString",:site=>[REDACTED])two_legged_sign_request_with_oauth(consumer)get:index,{:api_version=>'v1',:format=>:json}response.shouldbe_successend
I can make a request via
rails console
fine, so I know the app has been implemented correctly. When using the provided helper methods to sign the simple get request in the controller spec, the request does not appear to be signed correctly. Am I doing something wrong?The successful console call:
The failed controller test:
My versions are:
Is this a bug? If not, can anybody point me in the right direction for testing controllers that are
oauthenticated
with a 2-legged approach?The text was updated successfully, but these errors were encountered: