Sha256: 325585f1b8c8cf40f45afd77d43b016b2d3bc922e88a178bee3938d5995e21a7

Contents?: true

Size: 787 Bytes

Versions: 3

Compression:

Stored size: 787 Bytes

Contents

require 'test_helper'

class Custom::ConfirmationsControllerTest < ActionController::TestCase
  describe Custom::ConfirmationsController do
    before do
      @redirect_url = Faker::Internet.url
      @new_user = users(:unconfirmed_email_user)
      @new_user.send_confirmation_instructions(redirect_url: @redirect_url)
      @mail          = ActionMailer::Base.deliveries.last
      @token         = @mail.body.match(/confirmation_token=([^&]*)&/)[1]
      @client_config = @mail.body.match(/config=([^&]*)&/)[1]

      get :show,
          params: { confirmation_token: @token, redirect_url: @redirect_url }
    end

    test 'yield resource to block on show success' do
      assert @controller.show_block_called?, 'show failed to yield resource to provided block'
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
devise_token_auth-0.1.43 test/controllers/custom/custom_confirmations_controller_test.rb
digix_devise_token_auth-0.1.44 test/controllers/custom/custom_confirmations_controller_test.rb
devise_token_auth-0.1.43.beta1 test/controllers/custom/custom_confirmations_controller_test.rb