Jump to content

The ultimate community for Ruby on Rails developers.


Doorkeeper and Minitest

minitest doorkeeper controller

  • Please log in to reply
No replies to this topic

#1 jleecbd



  • Members
  • 4 posts

Posted 20 November 2013 - 05:12 AM

Full disclosure:  there is a lot in the Ruby language that I realize I just don't get, so I'd appreciate some patience :).


I'm using minutest in a project, and I've added doorkeeper to the mix so that I can provide a fairly limited API for a couple of functions, primarily for third party integrations for some of our administrators.


Still trying to break out of my old habits (I started out on MC6809 assembly, so I'm pretty ancient), I of course wrote the code first, and then realized I should write some tests.


I'm trying to follow the directions from here:  https://github.com/a...ted-controllers


But I can't work out how to do the stubbing with Minitest.


I've got the following (partial code):


class UsersControllerTest < ActionController::TestCase

      let(:token) {stubs :accessible? => true}

      test "Should return list of users to authenticated user" do

             controller = UsersController.new()
             controller.stub :doorkeeper_token {token}
            #soon to be actual tests, but not yet


I am given an error that I don't have the correct number of arguments.  I realize that the minitest stub method wants a second argument, but I'm not quite sure which one to send it, especially in the context of doorkeeper.


Any guidance, particularly education for this rather slow witted programmer would be appreciated.


Also tagged with one or more of these keywords: minitest, doorkeeper, controller

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users