spec/requests/flows/password_spec.rb in doorkeeper-1.2.0 vs spec/requests/flows/password_spec.rb in doorkeeper-1.3.0

- old
+ new

@@ -56,9 +56,21 @@ token = Doorkeeper::AccessToken.first should_have_json 'refresh_token', token.refresh_token end + + scenario 'should return the same token if it is still accessible' do + Doorkeeper.configuration.stub(:reuse_access_token).and_return(true) + + client_is_authorized(@client, @resource_owner) + + post password_token_endpoint_url(client: @client, resource_owner: @resource_owner) + + Doorkeeper::AccessToken.count.should be(1) + + should_have_json 'access_token', Doorkeeper::AccessToken.first.token + end end context 'with invalid user credentials' do scenario 'should not issue new token with bad password' do expect do